Open flipflopsimsommer opened 9 years ago
why:
i want to deploy servers for projekts as needed, so the first time the server start i will execute
./bin/cmd -u <url> -r <projekttoken>
to register it, later the token is in the config and the registertoken will not be needed.
how i understand it:
there are 2 tokens the runner token and the registertoken with wich you need to get a new runner token. since no runner token is provided in my cmd call it will look for registerToken and register the runner to get the runner toke.
what it does:
i wanted to register and start a new runner from cli without questions.
@evanlucas let me know if you have more questions or if i should chance something. imho what i added might also be usefull for others. BR
Actual for me! I prefer to configure container service once and then just scale up their number. Every gitlab runner is not so unique for me, I just need free one at some moment of time. For my runners config I must use "expect" command, cause need to pass reg. token to not friendly gcr dialog interface.
Hey @flipflopsimsommer. I'm trying to get these PRs taken care of. Can you clean up the conflicts and rebase off current master? I definitely think this is a good addition.
@bushong1 can do, i will look at it tomorrow
@bushong1 let me know if you need anything else, looking forward of using your repo again.
Okay, i added some comments on cleaning it up. I'm also trying to walk through the logic.
So, the main issue is that this application doesn't allow the user to manually set a "Registration Token", and GitLab doesn't allow the user to procure a single-use "Runner Token" outside of the API. To be clear, a Registration Token is what you receive from the gitlab project page/runner registration page. When the application connects the first time, it will take the Runner Token, make a request to api/v1/runners/register.json
, and get a "Runner Token", then gcr
stores that in the ~/.config/gcr.json
.
This update is trying to allow a gcr instance to register without asking a human for input. Logic chart is as follows:
true
; Register Token = true
OR false
false
; Register Token = true
false
; Register Token = false
Does that sound right?
Thanks for the contribution! Can you please explain the change and why it is needed? Thanks!