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
相关推荐
dapeng-大鹏2 小时前
记一次 GitLab Let‘s Encrypt 证书申请失败的排查与修复
gitlab
身如柳絮随风扬6 小时前
使用 Docker 部署 GitLab 并分配用户账号 —— 保姆级教程
docker·容器·gitlab
鼎道开发者联盟1 天前
鼎享会 | 从手工到自动化:OpenClaw改造GitLab内部协作流程的全过程
自动化·gitlab·openclaw
ℳ₯㎕ddzོꦿ࿐2 天前
告别手工发版:用 GitLab CI/CD 打通前后端自动化部署的“任督二脉”
ci/cd·自动化·gitlab
ℳ₯㎕ddzོꦿ࿐2 天前
实战:在 Linux 系统用 Docker-Compose 优雅部署 GitLab 及防坑指南
linux·docker·gitlab
源图客2 天前
Linux(CentOS9)服务器部署gitlab-ce-18.11.1-ce.0.el9.x86_64.rpm
linux·服务器·gitlab
ℳ₯㎕ddzོꦿ࿐2 天前
实战篇:结合 GitLab CI/CD 实现 Spring Cloud 微服务自动化部署与防坑指南
spring cloud·ci/cd·gitlab
菜萝卜子3 天前
【Git】GitLab 18.9 全局服务器钩子(Server Hooks)官方规范与落地实践
服务器·git·gitlab
lilili也4 天前
Git、VScode、GitLab
git·vscode·gitlab
郭龙_Jack5 天前
Gitlab CICD流水线设计
gitlab