When I register a runner, I can list my runner details with:
# gitlab-runner list
Runtime platform arch=amd64 os=linux pid=103997 revision=7a6612da version=13.12.0
Listing configured runners ConfigFile=/etc/gitlab-runner/config.toml
runner-myproject Executor=docker Token=xxx URL=https://gitlab.example.com
So I have the authentication_token in that response (also available in my config.toml). From that runner token, how can I determine the runner ID?
I would like a cron that checks if the runner is busy and if not, it deregisters the runner from the autoscaling group:
- Checks if the runner has active jobs
- Pause the runner if there are 0 active jobs (would probably ensure that it has been idle for a while).
- Deregister the runner from GitLab.
- Deregister the runner instance from the AWS autoscaling group.
However, the API only works with the runner ID and all I know about the runner is the Token.