Skip to content
Snippets Groups Projects
Commit e2af746b authored by Adrian Schmitz's avatar Adrian Schmitz
Browse files

HOTFIX: Use the installed runner for registration

parent 814b3910
No related branches found
No related tags found
No related merge requests found
......@@ -100,13 +100,6 @@ def CLI():
"default": "utility/runtime",
"help": "Path where utility files are located. Downscoped users need read access."
},
{
"flags": ["-rip", "--runner-install-path"],
"type": str,
"metavar": "<name>",
"default": "utility/runtime/bin",
"help": "The path where the runner is installed."
},
{
"flags": ["-up", "--user-path"],
"type": str,
......@@ -159,6 +152,13 @@ def CLI():
"default": "./install",
"help": "The path where the runner is installed."
},
{
"flags": ["-rip", "--runner-install-path"],
"type": str,
"metavar": "<name>",
"default": "utility/runtime/bin",
"help": "The path where the runner is installed."
},
]
}
......@@ -261,18 +261,24 @@ def install():
set_utility_permissions(_runner_install_path, ['gitlab-runner'])
set_utility_permissions(args.rt_utility_path)
def add_registration(runner_path=''):
def runner_registration(runner_path=''):
# Register Gitlab Runner
if runner_path: runner_path += '/'
os.system(
f'{runner_path}gitlab-runner register --non-interactive --url "{args.registration_url}" --registration-token "{args.registration_token}"\
--executor "custom" --description "{args.runner_name}" --tag-list "{args.tag_list}" --run-untagged="false" --locked="false" \
--access-level="not_protected"\
--custom-prepare-exec="{args.install_path}/main.sh" --custom-config-exec="{args.install_path}/main.sh"\
--custom-run-exec="{args.install_path}/main.sh" --custom-cleanup-exec="{args.install_path}/main.sh"\
--custom-prepare-args="prepare" --custom-config-args="config"\
--custom-run-args="run" --custom-cleanup-args="cleanup"')
--executor "custom" --description "{args.runner_name}" --tag-list "{args.tag_list}" --run-untagged="false" --locked="false" \
--access-level="not_protected"\
--custom-prepare-exec="{args.install_path}/main.sh" --custom-config-exec="{args.install_path}/main.sh"\
--custom-run-exec="{args.install_path}/main.sh" --custom-cleanup-exec="{args.install_path}/main.sh"\
--custom-prepare-args="prepare" --custom-config-args="config"\
--custom-run-args="run" --custom-cleanup-args="cleanup"')
def add_registration(runner_path=''):
from shutil import which
if which("gitlab-runner") is None:
runner_registration(args.runner_install_path)
else:
runner_registration(runner_path)
os.system(f"sed -i 's/concurrent = 1/concurrent = {args.concurrency}/g' $HOME/.gitlab-runner/config.toml")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment