Skip to content

Commit f4fb30a

Browse files
authored
Merge pull request #47 from rajsinghtech/add-kustomize-check
2 parents f17cc1f + 8d78200 commit f4fb30a

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed
Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
name: Kustomize Validation
22

33
on:
4-
push:
4+
pull_request:
55
branches:
66
- '**'
7-
pull_request:
7+
paths:
8+
- 'clusters/talos-robbinsdale/apps/**'
9+
push:
810
branches:
911
- '**'
12+
paths:
13+
- 'clusters/talos-robbinsdale/apps/**'
1014

1115
jobs:
12-
validate-kustomize:
16+
validate:
1317
runs-on: ubuntu-latest
1418
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
17-
19+
- uses: actions/checkout@v4
20+
1821
- name: Install Kustomize
1922
run: |
20-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
21-
sudo mv kustomize /usr/local/bin/
22-
23+
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
24+
2325
- name: Install Helm
24-
uses: azure/setup-helm@v3
25-
with:
26-
version: 'latest'
27-
26+
run: |
27+
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
28+
chmod 700 get_helm.sh
29+
./get_helm.sh
30+
2831
- name: Validate Kustomize builds
2932
run: |
3033
find clusters/talos-robbinsdale/apps/* -type d -maxdepth 0 | while read dir; do
31-
echo "Validating kustomize build for $dir"
34+
echo "Validating $dir..."
3235
if [ -f "$dir/kustomization.yaml" ]; then
33-
kustomize build --enable-helm "$dir"
34-
if [ $? -ne 0 ]; then
35-
echo "Error: Kustomize build failed for $dir"
36-
exit 1
37-
fi
38-
else
39-
echo "Skipping $dir - no kustomization.yaml found"
36+
KUBERNETES_VERSION=1.30.0 kustomize build --enable-helm "$dir" || exit 1
4037
fi
4138
done

0 commit comments

Comments
 (0)