@@ -48,18 +48,18 @@ jobs:
4848 minikube status
4949
5050 - name : Load images from artifacts
51- uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
51+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
5252 with :
5353 path : built-docker-image
5454 pattern : built-docker-image-*
5555 merge-multiple : true
5656
5757 - name : Load docker images
58- timeout-minutes : 10
58+ timeout-minutes : 15
5959 run : |-
6060 eval $(minikube docker-env)
61- docker load -i built-docker-image/nginx-${{ matrix.os }}_img
62- docker load -i built-docker-image/django-${{ matrix.os }}_img
61+ docker load -i built-docker-image/nginx-${{ matrix.os }}-ubuntu-latest_img
62+ docker load -i built-docker-image/django-${{ matrix.os }}-ubuntu-latest_img
6363 docker images
6464
6565 - name : Configure HELM repos
8585 ./helm/defectdojo \
8686 --set django.ingress.enabled=true \
8787 --set imagePullPolicy=Never \
88+ --set initializer.keepSeconds="-1" \
8889 ${{ env[matrix.databases] }} \
8990 ${{ env[matrix.brokers] }} \
9091 --set createSecret=true \
@@ -124,10 +125,15 @@ jobs:
124125 RETRY=0
125126 while :
126127 do
128+ DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
127129 OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
128130 --overrides='{ "apiVersion": "v1" }' \
129- --restart=Never -i --rm -- -s -m 20 -I --header "Host: $DD_HOSTNAME" http://`kubectl get service defectdojo-django -o json \
130- | jq -r '.spec.clusterIP'`/login?next=/)
131+ --restart=Never -i --rm -- \
132+ --silent \
133+ --max-time 20 \
134+ --head \
135+ --header "Host: $DD_HOSTNAME" \
136+ http://$DJANGO_IP/login?next=/)
131137 echo $OUT
132138 CR=`echo $OUT | egrep "^HTTP" | cut -d' ' -f2`
133139 echo $CR
@@ -148,6 +154,26 @@ jobs:
148154 break
149155 fi
150156 done
157+ ADMIN_PASS=$(kubectl get secret/defectdojo -o jsonpath='{.data.DD_ADMIN_PASSWORD}' | base64 -d)
158+ echo "Simple API check"
159+ DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
160+ CR=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
161+ --overrides='{ "apiVersion": "v1" }' \
162+ --restart=Never -i --rm -- \
163+ --silent \
164+ --max-time 20 \
165+ --header "Host: $DD_HOSTNAME" \
166+ --data-raw "username=admin&password=$ADMIN_PASS" \
167+ --output /dev/null \
168+ --write-out "%{http_code}\n" \
169+ http://$DJANGO_IP/api/v2/api-token-auth/)
170+ echo $CR
171+ if [[ $CR -ne 200 ]]; then
172+ echo "ERROR: login is not possible; got HTTP code $CR"
173+ exit 1
174+ else
175+ echo "Result received"
176+ fi
151177 echo "Final Check of components"
152178 errors=`kubectl get pods | grep Error | awk '{print $1}'`
153179 if [[ ! -z $errors ]]; then
0 commit comments