-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (52 loc) · 1.77 KB
/
check-generated-values.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
on: push
name: Check values files
jobs:
diff:
runs-on: ubuntu-latest
env:
TMP_DIR: "/tmp/shared"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Create directories
run: |
mkdir -p ~/.local/bin
mkdir -p "${TMP_DIR}"
chmod 777 "${TMP_DIR}"
- name: Create helmfile docker shim
run: |
docker pull ghcr.io/helmfile/helmfile:latest
echo 'docker run \
--rm \
--volume "${TMP_DIR}:${TMP_DIR}" \
--volume "${PWD}:/workdir" \
--workdir /workdir \
--user $(id -u):$(id -g) \
ghcr.io/helmfile/helmfile:latest helmfile $*' \
| tee ~/.local/bin/helmfile
chmod +x ~/.local/bin/helmfile
- name: Create yq docker shim
run: |
docker pull mikefarah/yq:latest
echo 'docker run \
--rm \
--volume "${TMP_DIR}:${TMP_DIR}" \
--volume "${PWD}:/workdir" \
--workdir /workdir \
--user $(id -u):$(id -g) \
mikefarah/yq:latest $*' \
| tee ~/.local/bin/yq
chmod +x ~/.local/bin/yq
- name: Diff current values files against generated ones
run: >
set -x;
for ENV_DIR in k8s/argocd/*; do
ENV=$(basename "${ENV_DIR}")
for RELEASE_FILE in "${ENV_DIR}"/*.values.yaml; do
RELEASE=$(basename "${RELEASE_FILE}" .values.yaml)
TMP_VALUES="${TMP_DIR}"/tmp_"${ENV}.${RELEASE}".yml
echo "checking $RELEASE_FILE - [$ENV] [$RELEASE]"
./bin/generate-values "${ENV}" "${RELEASE}" "${TMP_VALUES}"
diff "${TMP_VALUES}" "${RELEASE_FILE}"
done
done