Skip to content

Conversation

@DEvil0000
Copy link
Contributor

added option to not register/unregister every start/stop but reuse a runner config instead

podman run -it \
-e PRIVATE_KEY="$(cat <private key filename>)"
--env-file=env.txt \
-v ~/runner.toml:/home/gitlab-runner/.gitlab-runner/config.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this line is not necessary for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since I do not set UNREGISTER_ON_EXIT and REGISTER_ON_ENTER by default it makes perfectly sense to volume/persist the runner config by default.
This however depends on how you want to run it.

--custom-run-exec="$HOME"/run.py \
--custom-cleanup-exec="$HOME"/cleanup.py
else
gitlab-runner start
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already gitlab-runner run command below. Moreover, gitlab-runner start requires root.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, there is no gitlab-runner run in the script but a gitlab-runner register this does execute register and start in one command. That is actually why I changed this with this changeset so you can start without register. Same goes for unregister.
You may have needed root if your mounted config file (volume) had incorrect permissions/owner on your system.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, the last line containing gitlab-runner run was hidden in the changeset so i did not see it and not realize.
I am not exactly sure what the difference between start and run is. The man page and docs do not make this more clear to me. is start as service and run as foreground? or do you need to call bost? Maybe you can help me understand this better?
It did however work for me like this and I did not face a issue till now.
Also I can tell register/unregister is not what I want all the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants