Re-installing or Fixing a broken gitlab runner

Remove the runner from Gitlab web UI and also
gitlab-runner stop # stops the service
gitlab-runner uninstall # remove service settings (old/broken info) so  it will not auto-start
Also removing orphelian runners:
gitlab-runner verify --delete
Make sure a compatible (Mayor.Minor should match) version of gitlab-runner is installed. . In my case I had to install v12.10.3 because my server was a bit old. Further instructions can be found in gitlab site. (My previous installation was via homebrew so I did brew uninstall gitlab-runner.) Some old versions are not available in on s3 so we should search in github releases or check Download any other tagged release page.
curl --output /usr/local/bin/gitlab-runner https://s3.amazonaws.com/gitlab-runner-downloads/v12.10.3/binaries/gitlab-runner-darwin-amd64

chmod +x /usr/local/bin/gitlab-runner
Now register new gitlab runner, use url and token provided by Gitlab web UI
gitlab-runner register \
    --name my-runner \
    --url http://gitlab.example.com \
    --registration-token my-registration-token \
    --tag-list tag1,tag2,tag3
Now we can re-install and start the service.
gitlab-runner install # re-install the service with the new info
gitlab-runner start
gitlab-runner status
gitlab-runner verify

0 comments :

This work is licensed under BSD Zero Clause License | nacho4d ®