gitlab-runner注册执行器

gitlab-runner注册执行器

  1. 打开gitlab上的项目页,Settings->CI/CD->Runners->create project runner
    创建好后会生成registration token,后面会用
  2. 下载gitlab-runner 并保存到目录文件夹下,重命名为gitlab-runner.exe
    下载地址:https://docs.gitlab.com/runner/install/bleeding-edge/#download-the-binary
    比如https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/main/binaries/gitlab-runner-windows-amd64.exe
  3. 以管理员运行powershell
  4. cd 到项目目录下
  5. 执行
bash 复制代码
.\gitlab-runner register
bash 复制代码
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab.com/
Enter the registration token:
GR...
Enter a description for the runner:
[CHINAMI-ULH9Q72]: my-windows-runner
Enter tags for the runner (comma-separated):
windows
Enter optional maintenance note for the runner:
runner
...省略输出
ssh, docker+machine, docker-autoscaler:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

注册成功后,会在当前目录生成一个 config.toml 文件,如果存在,说明注册信息已保存。

6.启动 Runner

a.方式1

bash 复制代码
.\gitlab-runner.exe run

此时刷新 GitLab 页面,"Runner has never contacted..." 会消失,状态变为绿色 ●(在线)。

⚠️ 缺点:关闭 PowerShell 窗口,Runner 就停止了。

b.方式2

bash 复制代码
cd D:\workspace\auto_pull

# 安装服务(使用当前用户权限)
.\gitlab-runner.exe install --user ".\CHINAMI-ULH9Q72" --password ""

# 启动服务
.\gitlab-runner.exe start
相关推荐
cuijiecheng20184 小时前
GitLab创建项目
gitlab
_运维那些事儿2 天前
GitLabCI/CD语法
linux·服务器·git·ci/cd·gitlab·运维开发·devops
_运维那些事儿2 天前
GitLab&Jenkins
运维·ci/cd·gitlab·jenkins·devops
Jeacean3 天前
gitlab 仓库所有分支开启分支保护脚本
gitlab
nhfc993 天前
Gitlab备份且提交Windows服务器数据
服务器·windows·gitlab
Knight_AL3 天前
Jenkins 配置 GitLab 认证并实现自动化部署
自动化·gitlab·jenkins
危笑ioi4 天前
docker部署jenkins/gitlab/nexus3/nginx配置端口转发与ssl
nginx·docker·gitlab·jenkins·ssl
木易 士心6 天前
GitLab 安装指南
git·gitlab
Linux运维技术栈6 天前
GitLab社区版备份优化:3M包为何是独立完整备份?
运维·git·gitlab
z.q.xiao7 天前
【镜像模式】WSL如何访问windows内网服务
linux·网络·windows·gitlab·wsl·dns