GitLab CI/CD:GitLab Runner
GitLab Runner 安装
使用 GitLab repository 安装runner
1、添加GitLab repository
For Debian/Ubuntu/Mint
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
For RHEL/CentOS/Fedora
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | sudo bash
2、安装最新版本的GitLab Runner
For Debian/Ubuntu/Mint
export GITLAB_RUNNER_DISABLE_SKEL=true; sudo -E apt-get install gitlab-runner
For RHEL/CentOS/Fedora
export GITLAB_RUNNER_DISABLE_SKEL=true; sudo -E yum install gitlab-runner
或安装指定版本
for DEB based systems
apt-cache madison gitlab-runner export GITLAB_RUNNER_DISABLE_SKEL=true; sudo -E apt-get install gitlab-runner=10.0.0
for RPM based systems
yum list gitlab-runner --showduplicates | sort -r export GITLAB_RUNNER_DISABLE_SKEL=true; sudo -E yum install gitlab-runner-10.0.0-1
离线安装
1、下载离线包:https://gitlab-runner-downloads.s3.amazonaws.com/latest/index.html
2、安装离线包(需要提前安装Git)
For example, for Debian or Ubuntu
dpkg -i gitlab-runner_<arch>.deb
For example, for CentOS or Red Hat Enterprise Linux
rpm -i gitlab-runner_<arch>.rpm
GitLab Runner 注册
1、执行gitlab-runner register,进入交互界面(ps:如果想要在同一个机器上注册多个不同的runner,可以重复执行gitlab-runner register)
linux
sudo gitlab-runner register
mac
gitlab-runner register
windows
./gitlab-runner.exe register
2、根据提示交互提示输入信息
3、完成注册
关于GitLab Runner的配置
官方文档:https://docs.gitlab.com/runner/configuration/
GitLab Runner 常用命令
本文参考链接:
https://docs.gitlab.com/