-
Notifications
You must be signed in to change notification settings - Fork 5
added runner reuse instead of register/unregister every time #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,11 @@ | |
| trap cleanup 1 2 3 6 | ||
|
|
||
| cleanup() { | ||
| gitlab-runner unregister --all-runners | ||
| if [[ "$UNREGISTER_ON_EXIT" ]]; then | ||
| gitlab-runner unregister --all-runners | ||
| else | ||
| gitlab-runner stop | ||
| fi | ||
| sleep 5 | ||
| } | ||
|
|
||
|
|
@@ -14,12 +18,16 @@ fi | |
|
|
||
| echo "$PRIVATE_KEY" > "$HOME"/priv_key | ||
|
|
||
| if [[ "$REGISTER_ON_ENTER" ]]; then | ||
| gitlab-runner register --non-interactive \ | ||
| --executor=custom \ | ||
| --custom-config-exec="$HOME"/config.sh \ | ||
| --custom-prepare-exec="$HOME"/prepare.py \ | ||
| --custom-run-exec="$HOME"/run.py \ | ||
| --custom-cleanup-exec="$HOME"/cleanup.py | ||
| else | ||
| gitlab-runner start | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, there is no
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, the last line containing |
||
| fi | ||
|
|
||
| if [[ "$CONCURRENT" ]]; then | ||
| sed -i "s/concurrent = .*/concurrent = $CONCURRENT/g" "$HOME"/.gitlab-runner/config.toml | ||
|
|
||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.