Redoing my setup after many years #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: helm setup | |
uses: stefanprodan/[email protected] | |
with: | |
kubectl: 1.16.2 | |
kustomize: 3.2.1 | |
helm: 2.15.1 | |
command: | | |
helm init --client-only | |
- name: check apps and configs | |
uses: stefanprodan/[email protected] | |
with: | |
kubectl: 1.16.2 | |
kustomize: 3.2.1 | |
helm: 2.15.1 | |
command: | | |
if [ -f "apps/Chart.yaml" ]; then | |
echo "apps/ is a helm chart" | |
helm dependency update apps | |
helm template apps --values apps/values.yaml |kubeval --strict --ignore-missing-schemas | |
else | |
echo "apps/ doesn't look to be a helm chart" | |
fi | |
echo | |
for d in $(ls configs/); do | |
if [ -f "configs/$d/Chart.yaml" ]; then | |
echo "configs/$d is a helm chart" | |
helm dependency update configs/$d | |
helm template configs/$d --values configs/$d/values.yaml |kubeval --strict --ignore-missing-schemas | |
elif [ -f "configs/$d/kustomization.yaml" ]; then | |
echo "configs/$d uses Kustomize" | |
kustomize build configs/$d/ |kubeval --strict --ignore-missing-schemas | |
elif [ $(find ./configs/$d -maxdepth 1 -type f -name "*.yaml" |wc -l) -gt 0 ]; then | |
echo "configs/$d looks like raw yaml files" | |
kubeval configs/$d/*.yaml --strict --ignore-missing-schemas | |
else | |
echo "configs/$d doesn't look like it cotains any configs" | |
fi | |
echo | |
done | |
if [ $(find ./test-files -maxdepth 1 -type f -name "*.yaml" |wc -l) -gt 0 ]; then | |
echo "test-files/ looks like raw yaml files" | |
kubeval test-files/*.yaml --strict --ignore-missing-schemas | |
fi | |
- name: Audit with Polaris | |
run: | | |
export VERSION='0.5.0' | |
curl -s -L https://github.com/FairwindsOps/polaris/releases/download/${VERSION}/polaris_${VERSION}_Linux_x86_64.tar.gz |sudo tar -xz -C /usr/local/bin | |
/usr/local/bin/polaris --version | |
/usr/local/bin/polaris --audit --audit-path ./configs/ |