41 lines
1.5 KiB
Markdown
41 lines
1.5 KiB
Markdown
# gitlab runner
|
|
|
|
## start gitlab runner
|
|
|
|
```shell script
|
|
docker run -d --name gitlab-runner --restart always -v /var/run/docker.sock:/var/run/docker.sock -v gitlab-runner-config:/etc/gitlab-runner gitlab/gitlab-runner:latest
|
|
```
|
|
|
|
## register new runner
|
|
|
|
```shell script
|
|
gitlab-runner register -non-interactive --description "manualy registered gitlab runner" --url "http://172.17.0.1:8080/" --registration-token "3b79eb1f-32f3-4db2-ad1b-6702e476d839" --tag-list "docker,manual" --executor shell
|
|
```
|
|
|
|
with curl
|
|
|
|
```shell script
|
|
curl --request POST -H 'Content-Type: application/json' "http://localhost:8080/api/v4/runners" -d '{"description":"manualy registered gitlab runner","tag_list":"docker,manual","run_untagged":false,"locked":true,"active":true,"info":{"name":"gitlab-runner","version":"13.3.1","revision":"738bbe5a","platform":"linux","architecture":"amd64","features":{"variables":false,"image":false,"services":false,"artifacts":false,"cache":false,"shared":false,"upload_multiple_artifacts":false,"upload_raw_artifacts":false,"session":false,"terminal":false,"refspecs":false,"masking":false,"proxy":false,"raw_variables":false,"artifacts_exclude":false,"multi_build_steps":false}},"token":"registration_token"}'
|
|
```
|
|
|
|
## unregister runner
|
|
|
|
```shell script
|
|
gitlab-runner unregister --url "http://172.17.0.1:8080/" --token "3b79eb1f-32f3-4db2-ad1b-6702e476d839"
|
|
```
|
|
|
|
## list runners
|
|
|
|
```shell script
|
|
gitlab-runner list
|
|
```
|
|
local listing :
|
|
|
|
cf => /etc/gitlab-runner/config.toml
|
|
|
|
## verify which runner is always alive
|
|
|
|
```shell script
|
|
gitlab-runner verify --delete
|
|
```
|