Similarly I’m looking for a way to generate Runner’s authentication token as well? I cannot find the command to do it. Does it even exist? or how else can i do it via CLI ?
The authentication tokens differ by job (AFAIR), and I think the token for any particular job is available as an environment variable in that job, which I guess is pretty much where you might need it.
I’m looking for non-interactive (programatically) way of generating the authentication token and then create the runner using gitlab-runner register command…
I’ve checked the documentation and I can see that they actually use the term “authentication token” for the token used solely for registering a new token. I had forgotten that (I probably knew when I worked on automating runner registration in our setup and looked at that page regularly). That’s not what I was talking about and I’m sorry for causing some confusion.
The rails commands (gitlab-rails runner ...) are only usable on the GitLab servers, and the first requirement for registering a runner listed on:
says that the runner should be on a seperate server. But you can use the API to get an authentication token. I think there was a better page on how to do it than what I can find now, but here are the commands (slightly edited to hide secrets) I got working: