Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
gitlab-runner
Commits
677f2106
Commit
677f2106
authored
Apr 11, 2019
by
Michał "rysiek" Woźniak
Browse files
Support for envvar-based config (closes
#1
)
parent
47eaa022
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
Dockerfile
Dockerfile
+4
-0
entrypoint
entrypoint
+10
-0
No files found.
Dockerfile
View file @
677f2106
...
...
@@ -52,4 +52,8 @@ ENV LANGUAGE en_US:en
ENV
LC_ALL en_US.UTF-8
RUN
locale-gen en_US.UTF-8
# copy in the entrypoint script
COPY
entrypoint /
RUN
chmod
+x /entrypoint
VOLUME
["/etc/gitlab-runner", "/home/gitlab-runner", "/output"]
entrypoint
View file @
677f2106
...
...
@@ -26,5 +26,15 @@ if [ -f "${CA_CERTIFICATES_PATH}" ]; then
cmp
--silent
"
${
CA_CERTIFICATES_PATH
}
"
"
${
LOCAL_CA_PATH
}
"
||
update_ca
fi
# if we don't have a config file...
if
[[
!
-e
${
CONFIG_FILE
}
]]
;
then
# ...but we do have config vars...
if
[[
-n
${
CI_SERVER_URL
}
&&
-n
${
RUNNER_TOKEN
}
&&
-n
${
RUNNER_DESCRIPTION
}
&&
-n
${
RUNNER_EXECUTOR
}
]]
;
then
# register the runner
su gitlab-runner
-c
\
"gitlab-runner register --non-interactive --config '
${
CONFIG_FILE
}
' --url '
${
CI_SERVER_URL
}
' --registration-token '
${
RUNNER_TOKEN
}
' --description '
${
RUNNER_DESCRIPTION
}
' --executor '
${
RUNNER_EXECUTOR
}
'"
fi
fi
# launch gitlab-runner passing all arguments
exec
gitlab-runner
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment