chore(gitlab): signals, improve upgrade commands

This commit is contained in:
Michele Cereda
2024-10-29 23:33:54 +01:00
parent 226c3e20f0
commit 2e5e2920fc
7 changed files with 104 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ gitlab-runner register --url 'https://gitlab.example.com' --registration-token '
# Just list configured runners
gitlab-runner list -c '/etc/gitlab-runner/config.toml'
curl -fs 'https://gitlab.com/api/v4/runners/all?per_page=100' -H 'PRIVATE-TOKEN: glpat-m-…'
# Check configured runners can connect to the main instance
gitlab-runner verify -c '/etc/gitlab-runner/config.toml'
@@ -36,6 +37,20 @@ curl -fs 'https://gitlab.com/api/v4/runners/all?status=offline&per_page=100' -H
| jq '.[].id' \
| xargs -I 'runner_id' curl -fsX 'DELETE' "https://gitlab.com/api/v4/runners/runner_id" 'PRIVATE-TOKEN: glpat-m-…'
# Force reloading the configuration file
sudo kill -HUP $(pidof 'gitlab-runner')
sudo kill -s 'SIGHUP' $(pgrep 'gitlab-runner')
# Stop accepting new builds and exit as soon as currently running builds finish
# A.K.A. graceful shutdown
sudo kill -QUIT $(pgrep 'gitlab-runner')
sudo kill -s 'SIGQUIT' $(pidof 'gitlab-runner')
# Pause active runners
curl -fs 'https://gitlab.com/api/v4/runners/all?per_page=100&paused=false' -H 'PRIVATE-TOKEN: glpat-m-…' \
| jq '.[].id' - \
| xargs -I '{}' curl -fsX 'PUT' 'https://gitlab.com/api/v4/runners/{}' -H 'PRIVATE-TOKEN: glpat-m-…' -F 'paused=true'
###
# docker+machine executor