Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: walnuts1018 <[email protected]>
  • Loading branch information
walnuts1018 committed Oct 28, 2024
1 parent 115f713 commit fe06657
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ jobs:
# Helm Diff
- name: install dependencies
run: |
# Install jq
sudo wget https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 -O /usr/bin/jq
sudo chmod +x /usr/bin/jq
# Install yq
sudo wget https://github.com/mikefarah/yq/releases/download/v4.43.1/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
Expand Down Expand Up @@ -102,13 +98,19 @@ jobs:
eval $command | yq "sort_keys(..)" >> /tmp/manifests-head.yaml
done
sed -e "s/^\s*helm\.sh\/chart:\s+(.+)$//g" -i /tmp/manifests-head.yaml
sed -e "s/^\s*app\.kubernetes\.io\/version\:\s+(.+)$//g" -i /tmp/manifests-head.yaml
length=$(cat /tmp/helmreleases-base.json | jq -s length)
for i in $( seq 0 $(($length - 1)) ); do
cat /tmp/helmreleases-base.json | jq -rs ".[$i] | .spec.values" | tee values.json >> /dev/null
command=$(cat /tmp/helmreleases-base.json | jq -rs "\"helm template \" + .[$i].metadata.name + \" --namespace \" + .[$i].metadata.namespace + \" base-\" + .[$i].spec.chart.spec.sourceRef.name + \"-\" + .[$i].metadata.namespace + \"/\" + .[$i].spec.chart.spec.chart + \" --version \" + .[$i].spec.chart.spec.version + \" -f values.json\"")
eval $command | yq "sort_keys(..)" >> /tmp/manifests-base.yaml
done
sed -e "s/^\s*helm\.sh\/chart:\s+(.+)$//g" -i /tmp/manifests-base.yaml
sed -e "s/^\s*app\.kubernetes\.io\/version\:\s+(.+)$//g" -i /tmp/manifests-base.yaml
- name: Upload file status_job02.txt as an artifact
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit fe06657

Please sign in to comment.