-
Notifications
You must be signed in to change notification settings - Fork 36
/
extra-volume-mounts.yaml
40 lines (38 loc) · 1.59 KB
/
extra-volume-mounts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
agents:
queue: "{{.queue}}"
env:
BUILDKITE_GIT_MIRRORS_PATH: /tmp/buildkite-git-mirrors
steps:
- label: ":git: Write File to Git Mirror Dir"
key: write-file-to-git-mirror-dir
plugins:
- kubernetes:
podSpec:
containers:
- image: alpine:latest
command:
- touch /tmp/buildkite-git-mirrors/foo-$$(BUILDKITE_JOB_ID).txt
- image: alpine:latest
command:
- |-
COUNT=0
until [[ $$((COUNT++)) == 9 ]]; do
[[ -f "/tmp/buildkite-git-mirrors/foo-$${BUILDKITE_JOB_ID}.txt" ]] && break
echo "⚠️ Waiting for /tmp/buildkite-git-mirrors/foo-$${BUILDKITE_JOB_ID}.txt to be written..."
sleep 1
done
if ! [[ -f "/tmp/buildkite-git-mirrors/foo-$${BUILDKITE_JOB_ID}.txt" ]]; then
echo "⛔ /tmp/buildkite-git-mirrors/foo-$${BUILDKITE_JOB_ID}.txt has not been written"
exit 1
fi
echo "✅ /tmp/buildkite-git-mirrors/foo-$${BUILDKITE_JOB_ID}.txt has been written"
rm -f "/tmp/buildkite-git-mirrors/foo-$${BUILDKITE_JOB_ID}.txt"
volumes:
- name: host-volume
hostPath:
path: "/tmp/volumes/{{.queue}}"
type: DirectoryOrCreate
extraVolumeMounts:
- name: host-volume
mountPath: /tmp/buildkite-git-mirrors
subPath: buildkite-git-mirrors