Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Runner Mirror
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adrian Schmitz
Runner Mirror
Commits
e2af746b
Commit
e2af746b
authored
1 year ago
by
Adrian Schmitz
Browse files
Options
Downloads
Patches
Plain Diff
HOTFIX: Use the installed runner for registration
Signed-off-by:
Adrian Schmitz
<
a.schmitz@itc.rwth-aachen.de
>
parent
814b3910
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Installer.py
+21
-15
21 additions, 15 deletions
Installer.py
with
21 additions
and
15 deletions
Installer.py
+
21
−
15
View file @
e2af746b
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment