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
相关推荐
林鸿群1 天前
Ubuntu 26.04 本地安装 GitLab CE 完整教程(非 Docker 方式)
linux·ubuntu·gitlab·私有部署·代码托管·ubuntu 26.04·omnibus
ascarl20102 天前
IDEA 一直弹 GitLab 登录,VS Code 却能正常 `git push`?问题排查记录
git·gitlab·intellij-idea
企鹅郁金香4 天前
Gitlab和Confluence和Svn的备份
svn·gitlab·confluence·gitlab备份·svn备份·confluence备份
barbyQAQ4 天前
GitLab CI/CD 基本用法指南
java·ci/cd·gitlab
云中飞鸿5 天前
git、svn;TortoiseGit、TortoiseSVN;gitlab、github、bitbucket、bamboo有什么关系?
git·svn·gitlab
007张三丰8 天前
掌握核心!Git最常用的15个命令行:从入门到实战详解
git·gitlab·github·git命令行·常用命令行
人间打气筒(Ada)9 天前
gitlab私有仓库搭建
运维·gitlab·项目实战·devops·代码部署实战·版本控制仓库
黑蛋同志9 天前
Rocky Linux 10 上搭建 社区版 GitLab CE
linux·运维·gitlab
gpio_019 天前
自建gitlab服务器并用sakurafrp穿透
运维·服务器·gitlab
林鸿群9 天前
Git 实战:如何将本地 .NET 项目推送到 GitLab 私有仓库
git·gitlab·.net