@@ -2,11 +2,11 @@ name: k8s deployment
22on :
33 pull_request_target :
44 push :
5- branches :
6- - master
7- - dev
8- - release/**
9- - hotfix/**
5+ branches :
6+ - master
7+ - dev
8+ - release/**
9+ - hotfix/**
1010
1111env :
1212 DD_DOCKER_REPO : defectdojo
@@ -133,7 +133,7 @@ jobs:
133133 - name : Setup Minikube
134134135135 with :
136- minikube version : ' v1.14.0 '
136+ minikube version : ' v1.14.2 '
137137 kubernetes version : ' v1.19.2'
138138 driver : docker
139139 start args : ' --addons=ingress'
@@ -151,6 +151,7 @@ jobs:
151151 run : |-
152152 helm repo add stable https://charts.helm.sh/stable
153153 helm repo add bitnami https://charts.bitnami.com/bitnami
154+ helm dependency list ./helm/defectdojo
154155 helm dependency update ./helm/defectdojo
155156 - name : Set confings into Outputs
156157 id : set
@@ -181,27 +182,23 @@ jobs:
181182 kubectl get services
182183 - name : Check Application
183184 run : |-
185+ to_complete () {
186+ kubectl wait --for=$1 $2 --timeout=500s --selector=$3
187+ if [[ ${?} != 0 ]]; then
188+ echo "ERROR: $2"
189+ echo "INFO: status:"
190+ kubectl get pods
191+ echo "INFO: logs:"
192+ kubectl logs --selector=$3
193+ fi
194+ return ${?}
195+ }
184196 echo "Waiting for init job..."
185- kubectl wait --for="condition=Complete" job --timeout=500s --selector=defectdojo.org/component=initializer
186- if [[ ${?} != 0 ]]; then
187- echo "ERROR: Init job"
188- kubectl logs --selector=defectdojo.org/component=initializer
189- exit 1
190- fi
197+ to_complete "condition=Complete" job "defectdojo.org/component=initializer"
191198 echo "Waiting for celery pods..."
192- kubectl wait --for=condition=ready pod --timeout=500s --selector=defectdojo.org/component=celery
193- if [[ ${?} != 0 ]]; then
194- echo "ERROR: Celery "
195- kubectl logs --selector=defectdojo.org/component=celery
196- exit 1
197- fi
199+ to_complete "condition=ready" pod "defectdojo.org/component=celery"
198200 echo "Waiting for django pod..."
199- kubectl wait --for=condition=ready pod --timeout=500s --selector=defectdojo.org/component=django
200- if [[ ${?} != 0 ]];then
201- echo "ERROR: django "
202- kubectl logs --selector=defectdojo.org/component=django -c uwsgi
203- exit 1
204- fi
201+ to_complete "condition=ready" pod "defectdojo.org/component=django"
205202 echo "Pods up and ready to rumbole"
206203 kubectl get pods
207204 OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
0 commit comments