@@ -108,17 +108,17 @@ jobs:
108108 echo "INFO: status:"
109109 kubectl get pods
110110 echo "INFO: logs:"
111- kubectl logs --selector=$3 --all-containers=true
111+ kubectl logs --selector=$3 --all-containers=true
112112 exit 1
113113 fi
114114 return ${?}
115115 }
116116 echo "Waiting for init job..."
117- to_complete "condition=Complete" job "defectdojo.org/component=initializer"
117+ to_complete "condition=Complete" job "defectdojo.org/component=initializer"
118118 echo "Waiting for celery pods..."
119- to_complete "condition=ready" pod "defectdojo.org/component=celery"
119+ to_complete "condition=ready" pod "defectdojo.org/component=celery"
120120 echo "Waiting for django pod..."
121- to_complete "condition=ready" pod "defectdojo.org/component=django"
121+ to_complete "condition=ready" pod "defectdojo.org/component=django"
122122 echo "Pods up and ready to rumbole"
123123 kubectl get pods
124124 RETRY=0
@@ -132,15 +132,15 @@ jobs:
132132 --max-time 20 \
133133 --head \
134134 --header "Host: $DD_HOSTNAME" \
135- http://$DJANGO_IP/login?next=/)
135+ " http://${ DJANGO_IP} /login?next=/" )
136136 echo $OUT
137- CR=` echo $OUT | egrep "^HTTP" | cut -d' ' -f2`
137+ CR=$( echo $OUT | egrep "^HTTP" | cut -d' ' -f2)
138138 echo $CR
139139 if [[ $CR -ne 200 ]]; then
140140 echo $RETRY
141141 if [[ $RETRY -gt 2 ]]; then
142142 kubectl get pods
143- echo ` kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi`
143+ echo $( kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi)
144144 echo "ERROR: cannot display login screen; got HTTP code $CR"
145145 exit 1
146146 else
@@ -165,7 +165,7 @@ jobs:
165165 --data-raw "username=admin&password=$ADMIN_PASS" \
166166 --output /dev/null \
167167 --write-out "%{http_code}\n" \
168- http://$DJANGO_IP/api/v2/api-token-auth/)
168+ " http://${ DJANGO_IP} /api/v2/api-token-auth/" )
169169 echo $CR
170170 if [[ $CR -ne 200 ]]; then
171171 echo "ERROR: login is not possible; got HTTP code $CR"
@@ -174,8 +174,8 @@ jobs:
174174 echo "Result received"
175175 fi
176176 echo "Final Check of components"
177- errors=` kubectl get pods | grep Error | awk '{print $1}'`
178- if [[ ! -z $errors ]]; then
177+ errors=$( kubectl get pods | grep Error | awk '{print $1}')
178+ if [[ ! -z $errors ]]; then
179179 echo "Few pods with errors"
180180 for line in $errors; do
181181 echo "Dumping log from $line"
0 commit comments