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流水线了。

管线配置

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

相关推荐
A ?Charis1 天前
Gitlab-runner running on Kubernetes - hostAliases
容器·kubernetes·gitlab
秋说1 天前
开源代码管理平台Gitlab如何本地化部署并实现公网环境远程访问私有仓库
gitlab·源代码管理
极小狐1 天前
驭码上新,AI Code Review、基于代码库的知识问答,让研发起飞
gitlab·devsecops·devops·极狐gitlab·安全合规
蚊子不吸吸2 天前
DevOps开发运维简述
linux·运维·ci/cd·oracle·kubernetes·gitlab·devops
花开莫与流年错_5 天前
GitLab代码仓管理安装配置使用
运维·服务器·git·gitlab·配置·代码仓
极小狐7 天前
如何打开/关闭 GitLab 的版本检查功能?
gitlab·devsecops·devops·极狐gitlab·安全合规
玉石俱焚ing8 天前
ubuntu20上部署gitlab并开启ipv6访问
运维·gitlab
謬熙9 天前
GitHub、Gitee、GitLab介绍
gitee·gitlab·github
云围9 天前
Soanrquber集成Gitlab 之 导入Gitlab项目
运维·ci/cd·gitlab·devops
云围9 天前
Soanrquber集成Gitlab 之 gitlab用户配置和身份验证
ci/cd·gitlab·github·devops