Create a "GitLab Runner Registration Token" (the new method for 16.x+)

I am trying to create a gitlab runner token “the new way” as it is also mentioned here: Deprecation of the GitLab Runner Registration Token - YouTube

Of couse I know how to use the mouse and I know how to click.

I would love to use the CLI using the gitlab-rails console.

Unfortunately the documentation for that isn’t yet update for the Registration Token version.

Any Idea where I can start?

Any progress here?

I haven’t tried to see what can be done using the rails console, but if you have a personal access token with api access for a user with admin privileges it’s quite easy.

(The following is based on some notes I made when I tried)

It’s just two commands that you have to execute on the new runner server.
With the gitlab server on

curl -k -H 'Private-token: <token>' -X POST ''

This will create a token for registering a runner and return it in a JSON structure, I don’t remember what else is in there, but it’s quite easy to find,

gitlab-runner register --non-interactive --url --token glrt-MzPEy3ACVVTy-DxzCHnh --name NI_test_i_kitchen --executor shell

(That token is what was returned by the previous command, and I don’t remember what NI meant when I did that test, “i” is danish for “in”, and “kitchen” is the test framework I used for that)


I returned to that and just though that I would show the output from a command like the first one I gave:


it’s hardly necessary to format that piece of JSON nicely, I guess anybody can see what is there, and how to find the registration token in there.

1 Like
curl -k -H 'Private-token: <token>' -X POST ''

That did the trick.

Thank you very very much!