添加gitlab-runner官方源
sudo curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
更新及安装gitlab-runner
sudo apt-get update sudo apt-get install gitlab-runner
注册gitlab-runner(注意:debian或者Ubuntu注册时一定要使用sudo,否则gitlab无法连接) ```shell sudo gitlab-runner register
Runtime platform arch=amd64 os=linux pid=5243 revision=943fc252 version=13.7.0 Running in system-mode.
Enter the GitLab instance URL (for example, https://gitlab.com/): http://192.168.1.120/ # gitlab 访问地址 Enter the registration token: 54yjiXSkxSszs8mK57yG # 注册令牌,在gitlab中可以找到 Enter a description for the runner: [comedian]: runner # runner 描述 Enter tags for the runner (comma-separated): test # runner 标签,多个可以用,隔开 Registering runner… succeeded runner=54yjiXSk Enter an executor: custom, docker, kubernetes, docker-ssh, parallels, shell, ssh, virtualbox, docker+machine, docker-ssh+machine: shell # 运行环境 Runner registered successfully. Feel free to start it, but if it’s running already the config should be automatically reloaded! ```
- gitlab注册令牌
- 注册完成后
- 注意:注册成功后,gitlab-runner中Can run untagged jobs默认值为否,配置CI/CD时,需指定tags