gitlab runner

这里写自定义目录标题

install

复制代码
# Download the binary for your system
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

# Give it permission to execute
sudo chmod +x /usr/local/bin/gitlab-runner

# Create a GitLab Runner user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

# Install and run as a service
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start

register

在项目的主页面左侧边框点击 '设置'选择'CI/CD';

展开runner,将网址和 令牌信息注册到runner:

复制代码
$ sudo gitlab-runner register
Runtime platform                                    arch=amd64 os=linux pid=8950 revision=d89a789a version=16.4.1
Running in system-mode.                            
                                                   
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://git.xxx.net/
Enter the registration token:
GR1348941y7tDcpgyQasv2ugBybs-
Enter a description for the runner:
test
Enter tags for the runner (comma-separated):
test
Enter optional maintenance note for the runner:
test
WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://docs.gitlab.com/ee/ci/runners/new_creation_workflow 
Registering runner... succeeded                     runner=GR1348941y7tDcpgy
Enter an executor: docker, virtualbox, shell, ssh, docker-autoscaler, docker+machine, instance, custom, docker-windows, parallels, kubernetes:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
 
Configuration (with the authentication token) was saved in "/etc/gitlab-runner/config.toml" 
/home/gitlab-runner$ 

run

注册之后就可以运行'gitlab-runner run'启动runner,等待gitlab服务器下发job。

runner配置

注册完成后,刷新页面,显示runner信息,点击'、'编辑按钮,勾选'运行未标记的作业'

pipeline

在项目根目录提交一个 .gitlab-ci.yml 的文件。当提交了以后,就会触发pipeline流水线了。

管线配置

怎样限制自动触发,节省服务器

相关推荐
Aliex_git5 天前
Dockerfile 优化实践笔记
笔记·学习·gitlab
成为你的宁宁6 天前
Jenkins 自动化部署前后端分离若依项目全攻略:涵盖环境配置、Maven/Node.js 工具安装、GitLab 项目协同,及前后端构建、服务器推送与代码更新验证全步骤
node.js·自动化·gitlab·jenkins·maven
sunshinebo6 天前
一次 GitLab 无法启动的排查:Docker 日志把 500G 磁盘打满
docker·eureka·gitlab
何以不说话6 天前
DevOps、Git 和 GitLab
git·gitlab·devops
ZAEQgyKFs9 天前
永磁同步电机模型预测电流控制+滑模控制 [1]速度环采用滑模控制 滑模控制器采用新型趋近律与扰...
gitlab
马克Markorg9 天前
使用 Docker Compose 本地部署 GitLab 教程
docker·容器·gitlab
大尚来也12 天前
CI/CD 流水线搭建实战:GitHub Actions vs GitLab CI 2026 深度对比与选型指南
ci/cd·gitlab·github
ProgramHan13 天前
github、gitlab、gitee分别都是什么,为什么不能访问?
gitee·gitlab·github
Aliex_git15 天前
Gitlab Runner 配置实践
笔记·学习·ci/cd·gitlab
阿莫西林夹馍15 天前
GitLab的IP地址发生变更导致Runner掉线
gitlab