概述
1.安装gitlab-runner
1.下载gitlab-runner的二进制文件
# curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner- downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-386" (大概要半小时左右)
2.给二进制文件添加执行权限
# chmod +x /usr/local/bin/gitlab-runner
3.创建gitlab-ci用户
# useradd --comment 'GitLab Runner' --create-home test --shell /bin/bash
4.安装启动
# gitlab-runner install --user=test --working-directory=/home/test
5.查看gitlab-runner版本与信息
# gitlab-runner -v
2.注册gitlab-runner
# gitlab-runner register 手动填写注册
Runtime platform arch=amd64 os=linux pid=11348
revision=943fc252 version=13.6.0
Running in system-mode.
Enter the GitLab instance URL (for example, https://gitlab.com/):#输入gitlab的url
Enter the registration token: #输入注册令牌
Enter a description for the runner: #输入runner的描述 [gitlab-cicd]:
test
Enter tags for the runner (comma-separated): #输入标签
test
Registering runner... succeeded runner=K-_PmTnN
Enter an executor: virtualbox, custom, shell, ssh, docker+machine, docker-ssh+machine, kubernetes, docker, docker-ssh, parallels: #输入以何种方式提供runner
ssh
Enter the SSH server address (for example, my.server.com): #输入ssh的地址
192.168.38.160
Enter the SSH server port (for example, 22): #输入ssh的端口
22
Enter the SSH user (for example, root): #输入使用ssh的用户
root
Enter the SSH password (for example, docker.io): #输入使用ssh的用户的密码
123456
Enter the path to the SSH identity file (for example, /home/user/.ssh/id_rsa): #输入ssh私钥地址
/root/.ssh/id_rsa
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
显示successfully即为注册成功
url和注册令牌在gitlab-server上可以进行查询
3.gitlab-runner基本命令
# gitlab-runner status 查看运行状态
# gitlab-runner stop 关闭gitlab-runner
# gitlab-runner start 启动gitlab-runner
# gitlab-runner restart 重启gitlab-runner
最后
以上就是畅快小鸽子为你收集整理的gitlab 令牌使用_gitlab-runner的全部内容,希望文章能够帮你解决gitlab 令牌使用_gitlab-runner所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复