Skip to content

Commit d5b17d0

Browse files
authoredFeb 26, 2023
fix: install gitlab-runner after docker+machine driver (#704)
## Description As pointed out in #703 the GitLab Runner is installed and started before the docker+machine driver. But as the docker+machine driver needs some time for a complete installation (certificates, ...) it might happen that the GitLab Runner already tries to process jobs from GitLab. These jobs will fail. This PR changes the installation order of the GitLab Runner project and the docker+machine driver. The driver is installed first, the GitLab Runner second. This avoids running a non-working GitLab Runner setup. ⚠️ The restart of the GitLab Runner after executing user's post install script has been removed as a restart could possibly loose some jobs being processed by the GitLab Runner. If this is needed by your script, you have to add it there and be aware, that this might cause problems with the first jobs being processed. Closes #703
1 parent e5eeb10 commit d5b17d0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed
 

Diff for: ‎template/gitlab-runner.tpl

+6-7
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ then
7979
yum install amazon-ecr-credential-helper -y
8080
fi
8181

82-
if ! ( rpm -q gitlab-runner >/dev/null )
83-
then
84-
curl --fail --retry 6 -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | bash
85-
yum install gitlab-runner-${gitlab_runner_version} -y
86-
fi
87-
8882
if [[ "${runners_executor}" == "docker+machine" ]]
8983
then
9084
if [[ "${docker_machine_download_url}" == "" ]]
@@ -182,7 +176,12 @@ chkconfig --add remove_gitlab_registration
182176
# As noted above, this does nothing more than make the lockfile.
183177
service remove_gitlab_registration start
184178

179+
if ! ( rpm -q gitlab-runner >/dev/null )
180+
then
181+
curl --fail --retry 6 -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | bash
182+
yum install gitlab-runner-${gitlab_runner_version} -y
183+
fi
184+
185185
${post_install}
186186

187-
service gitlab-runner restart
188187
chkconfig gitlab-runner on

0 commit comments

Comments
 (0)
Please sign in to comment.