Skip to content

Commit 7a5f43e

Browse files
committed
Bind mount the ephemeral directory for git-mirrors into the main file system
1 parent e1c5f8b commit 7a5f43e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packer/linux/conf/bin/bk-install-elastic-stack.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ if [[ "${BUILDKITE_AGENT_ENABLE_GIT_MIRRORS_EXPERIMENT}" == "true" ]] ; then
134134
BUILDKITE_AGENT_EXPERIMENTS+=",git-mirrors"
135135
fi
136136

137+
BUILDKITE_AGENT_GIT_MIRRORS_PATH="/var/lib/buildkite-agent/git-mirrors"
138+
137139
if [ "${BUILDKITE_ENABLE_INSTANCE_STORAGE:-false}" == "true" ]
138140
then
139-
BUILDKITE_AGENT_GIT_MIRRORS_PATH="/mnt/ephemeral/git-mirrors"
140-
141-
mkdir -p "${BUILDKITE_AGENT_GIT_MIRRORS_PATH}"
142-
chown buildkite-agent: "${BUILDKITE_AGENT_GIT_MIRRORS_PATH}"
143-
else
144-
BUILDKITE_AGENT_GIT_MIRRORS_PATH="/var/lib/buildkite-agent/git-mirrors"
141+
EPHEMERAL_GIT_MIRRORS_PATH="/mnt/ephemeral/git-mirrors"
142+
mkdir -p "${EPHEMERAL_GIT_MIRRORS_PATH}"
143+
mount -o bind "${EPHEMERAL_GIT_MIRRORS_PATH}" "${BUILDKITE_AGENT_GIT_MIRRORS_PATH}"
144+
echo "${EPHEMERAL_GIT_MIRRORS_PATH} ${BUILDKITE_AGENT_GIT_MIRRORS_PATH} none defaults,bind 0 0" >>/etc/fstab
145145
fi
146146
fi
147147

0 commit comments

Comments
 (0)