-
Notifications
You must be signed in to change notification settings - Fork 143
133 lines (113 loc) · 3.71 KB
/
kustomize-nova.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# 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