Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-action: use actions for check-generated-values.yml #1737

Merged
merged 1 commit into from
Aug 20, 2024
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
41 changes: 5 additions & 36 deletions .github/workflows/check-generated-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,13 @@ 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: Set up yq
uses: frenck/action-setup-yq@v1
- name: Set up helmfile
uses: helmfile/[email protected]
- name: Diff current values files against generated ones
run: >
set -x;
Expand All @@ -49,7 +18,7 @@ jobs:

for RELEASE_FILE in "${ENV_DIR}"/*.values.yaml; do
RELEASE=$(basename "${RELEASE_FILE}" .values.yaml)
TMP_VALUES="${TMP_DIR}"/tmp_"${ENV}.${RELEASE}".yml
TMP_VALUES=$(mktemp)

echo "checking $RELEASE_FILE - [$ENV] [$RELEASE]"

Expand Down