我是靠谱客的博主 畅快小鸽子,这篇文章主要介绍gitlab 令牌使用_gitlab-runner,现在分享给大家,希望可以做个参考。

1.安装gitlab-runner

复制代码
1
2
3
4
5
6
7
8
9
10
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

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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上可以进行查询

d1121f132969c8a250630d9972a9dc78.png

9228fe74cde5f83d27c278aca7681786.png

3.gitlab-runner基本命令

复制代码
1
2
3
4
# gitlab-runner status 查看运行状态 # gitlab-runner stop 关闭gitlab-runner # gitlab-runner start 启动gitlab-runner # gitlab-runner restart 重启gitlab-runner

最后

以上就是畅快小鸽子最近收集整理的关于gitlab 令牌使用_gitlab-runner的全部内容,更多相关gitlab内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部