安装 Gitlab-Runner

在 Mac OS 上安装 Gitlab Runner

Step1:安装

brew install gitlab-runner
gitlab-runner --version

reference:
https://docs.gitlab.com/runner/
https://docs.gitlab.com/runner/install/index.html
install on Machttps://docs.gitlab.com/runner/install/osx.html


Step2:注册

gitlab-runner register
foxit@bogon yuping % gitlab-runner register
Runtime platform                                    arch=amd64 os=darwin pid=48821 revision=c6e7e194 version=14.8.2
WARNING: Running in user-mode.                     
WARNING: Use sudo for system-mode:                 
WARNING: $ sudo gitlab-runner...                   
                                                   
WARNING: [[ssh.disable_strict_host_key_checking]] is not set. Starting from 15.0, strict host checking will be enabled unless explicitly disabled. 
WARNING: SSH strict host checking is disabled. Consider setting [[ssh.disable_strict_host_key_checking]] to false (https://docs.gitlab.com/runner/executors/ssh.html#security). 
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab.com/
Enter the registration token:
GR1348xxxTCC4Jc4
Enter a description for the runner:
[bogon]: learning for gitlab
Enter tags for the runner (comma-separated):
ssh,ci,mac_os 
Enter optional maintenance note for the runner:
shell
Registering runner... succeeded                     runner=GR134894
Enter an executor: docker, docker-ssh, parallels, ssh, virtualbox, docker+machine, custom, shell, docker-ssh+machine, kubernetes:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 

registration token:
在这里插入图片描述
注册后,可以看到它已经上线了,可以编辑:
在这里插入图片描述
reference: https://docs.gitlab.com/runner/register/index.html#macos


Step3:开启

gitlab-runner start
gitlab-runner stop
gitlab-runner status
brew services start gitlab-runner
brew services stop gitlab-runner

在 Windows 上安装 Gitlab Runner

Step1:安装

创建文件夹: C:\Gitlab-Runner

下载包 64-bit or 32-bit ,并放入创建的文件夹中。

将文件改名为 gitlab-runner.exe (非必要操作)

Run cmd as Administrator:

C:\Windows\system32>cd C:\Gitlab-Runner
C:\Gitlab-Runner>
C:\Gitlab-Runner>gitlab-runner.exe install
Runtime platform                                    arch=amd64 os=windows pid=19460 revision=febb2a09 version=15.0.0

C:\Gitlab-Runner>gitlab-runner --version
Version:      15.0.0
Git revision: febb2a09
Git branch:   15-0-stable
GO version:   go1.17.7
Built:        2022-05-19T19:34:09+0000
OS/Arch:      windows/amd64

C:\Gitlab-Runner>gitlab-runner.exe start
Runtime platform                                    arch=amd64 os=windows pid=21320 revision=febb2a09 version=15.0.0

C:\Gitlab-Runner>gitlab-runner.exe stop
Runtime platform                                    arch=amd64 os=windows pid=8588 revision=febb2a09 version=15.0.0

C:\Gitlab-Runner>gitlab-runner.exe status
Runtime platform                                    arch=amd64 os=windows pid=12324 revision=febb2a09 version=15.0.0
gitlab-runner: Service has stopped

reference:https://docs.gitlab.com/runner/install/windows.html


Step2:注册

C:\Gitlab-Runner>gitlab-runner.exe register
Runtime platform                                    arch=amd64 os=windows pid=16400 revision=febb2a09 version=15.0.0
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab.com/
Enter the registration token:
GR13489xxxxxxxxxxxxxpTCC4Jc4
Enter a description for the runner:
[CN-NJ-yuping]: learning for gitlab on win
Enter tags for the runner (comma-separated):
ci,windows
Enter optional maintenance note for the runner:

Registering runner... succeeded                     runner=GR1348941stxanAtJ
Enter an executor: kubernetes, custom, docker, docker-ssh, virtualbox, docker-ssh+machine, docker-windows, parallels, shell, ssh, docker+machine:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

Step3:开启

C:\Gitlab-Runner>gitlab-runner.exe start
Runtime platform                                    arch=amd64 os=windows pid=18928 revision=febb2a09 version=15.0.0

检查是否注册成功:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_31362767/article/details/124992907