Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hack/gitlab-runner-vm/executor/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ if [ -d "${OPENSHELL_CONFIG}" ]; then
OPENSHELL_MOUNT=(-v "${OPENSHELL_STAGING}:/root/.config/openshell:ro,z")
fi

# Bind-mount the host's gitlab-runner binary into the container so that
# artifact upload/download and cache stages work with the custom executor.
# Without this, GitLab Runner's generated upload_artifacts_on_success script
# checks for `gitlab-runner --version` inside the container, fails to find it,
# and silently disables artifact upload — breaking downstream jobs that depend
# on artifacts.
GITLAB_RUNNER_MOUNT=()
if [ -x /usr/local/bin/gitlab-runner ]; then
GITLAB_RUNNER_MOUNT=(-v /usr/local/bin/gitlab-runner:/usr/local/bin/gitlab-runner:ro)
fi

echo "Creating container: ${CONTAINER_NAME}"
# Record the name before creating it: if prepare.sh dies between create and
# the write, cleanup.sh has no way to find the container and it leaks.
Expand All @@ -112,6 +123,7 @@ podman create \
-v "${BUILDS_DIR}:${BUILDS_DIR}:z" \
-v "${CACHE_DIR}:${CACHE_DIR}:z" \
"${OPENSHELL_MOUNT[@]}" \
"${GITLAB_RUNNER_MOUNT[@]}" \
-- "${IMAGE}" \
sleep infinity

Expand Down
Loading