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(): ...@@ -100,13 +100,6 @@ def CLI():
"default": "utility/runtime", "default": "utility/runtime",
"help": "Path where utility files are located. Downscoped users need read access." "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"], "flags": ["-up", "--user-path"],
"type": str, "type": str,
...@@ -159,6 +152,13 @@ def CLI(): ...@@ -159,6 +152,13 @@ def CLI():
"default": "./install", "default": "./install",
"help": "The path where the runner is installed." "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,8 +261,7 @@ def install(): ...@@ -261,8 +261,7 @@ def install():
set_utility_permissions(_runner_install_path, ['gitlab-runner']) set_utility_permissions(_runner_install_path, ['gitlab-runner'])
set_utility_permissions(args.rt_utility_path) set_utility_permissions(args.rt_utility_path)
def runner_registration(runner_path=''):
def add_registration(runner_path=''):
# Register Gitlab Runner # Register Gitlab Runner
if runner_path: runner_path += '/' if runner_path: runner_path += '/'
os.system( os.system(
...@@ -273,6 +272,13 @@ def add_registration(runner_path=''): ...@@ -273,6 +272,13 @@ def add_registration(runner_path=''):
--custom-run-exec="{args.install_path}/main.sh" --custom-cleanup-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-prepare-args="prepare" --custom-config-args="config"\
--custom-run-args="run" --custom-cleanup-args="cleanup"') --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") 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