Kustomize Nova #128
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
# vim:ts=2:sts=2:sw=2:et | |
# | |
# Author: Hari Sekhon | |
# Date: 2022-08-22 17:12:46 +0100 (Mon, 22 Aug 2022) | |
# | |
# https://github.com/HariSekhon/Kubernetes-configs | |
# | |
# License: see accompanying Hari Sekhon LICENSE file | |
# | |
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish | |
# | |
# https://www.linkedin.com/in/HariSekhon | |
# | |
--- | |
name: Kustomize Nova | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '*-kustomization.yaml' | |
- .github/workflows/kustomize-nova.yaml | |
#- .github/actions/install-kustomize/action.yaml | |
#- .github/actions/kustomizations-materizalize/action.yaml | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '*-kustomization.yaml' | |
- .github/workflows/kustomize-nova.yaml | |
#- .github/actions/install-kustomize/action.yaml | |
#- .github/actions/kustomizations-materialize/action.yaml | |
workflow_dispatch: # needs to be in default branch before you get the UI option to manually run though | |
inputs: | |
debug: | |
type: boolean | |
required: false | |
default: false | |
schedule: | |
- cron: '0 0 * * 1' | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -euxo pipefail {0} | |
env: | |
# due to GitHub Actions bug in boolean this doesn't work | |
#DEBUG: ${{ github.event.inputs.debug == true || '' }} | |
DEBUG: ${{ github.event.inputs.debug == 'true' || '' }} | |
jobs: | |
kustomize-nova: | |
name: Kustomize Nova | |
runs-on: ubuntu-latest | |
steps: | |
- name: Environment | |
run: env | sort | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: HariSekhon/DevOps-Bash-tools | |
submodules: 'true' # requires Git 2.18+ to be installed first | |
path: bash-tools | |
- name: Install Nova | |
#run: bash-tools/github/github_install_binary.sh FairwindsOps/nova 'nova_{version}_{os}_{arch}.tar.gz' latest nova /usr/local/bin/ | |
run: bash-tools/install/install_nova.sh | |
- name: Nova version | |
run: nova version | |
#- uses: ./.github/actions/install-kustomize | |
- name: Install Helm | |
run: bash-tools/install/install_helm.sh | |
- name: Helm version | |
run: helm version | |
- name: Install yq | |
run: bash-tools/install/install_yq.sh | |
- name: yq version | |
run: yq --version | |
- name: Create k8s Kind Cluster | |
uses: helm/kind-action@v1.3.0 | |
- name: Cluster Info | |
run: kubectl cluster-info | |
- name: 'Install Helm Charts found in all */base/kustomization.y*ml files' | |
run: | | |
# XXX: https://github.com/wiremind/wiremind-helm-charts/issues/259 | |
kustomizations="$(find . -type f -path '*/base/kustomization.y*ml' | grep -v clair/)" | |
# try twice in case of timeouts | |
export SKIP_EXISTING_HELM_INSTALLATIONS=1 | |
export SKIP_ERRORS=1 | |
bash-tools/kubernetes/kustomize_install_helm_charts.sh $kustomizations || | |
bash-tools/kubernetes/kustomize_install_helm_charts.sh $kustomizations | |
- name: Nova Find | |
run: nova find --wide --format=table | |
# doesn't help when the problem is ArtifactHub rate limiting: | |
# | |
# https://github.com/FairwindsOps/nova/issues/214 | |
# | |
#tries=3 | |
#for try in `seq $tries`; do | |
# set +e | |
# nova find --wide --format=table | |
# exitcode=$? | |
# set -e | |
# if [ $exitcode = 0 ]; then | |
# break | |
# fi | |
# if [ $try -lt $tries ]; then | |
# echo | |
# sleep 60 | |
# fi | |
# exit $exitcode | |
#done |