Skip to content
Snippets Groups Projects
Commit e0e47be5 authored by Athanasios Karmas's avatar Athanasios Karmas
Browse files

Minor improvement

parent 75943a35
No related branches found
No related tags found
No related merge requests found
Pipeline #3315 passed with stages
in 2 minutes and 34 seconds
...@@ -35,11 +35,11 @@ deploy-build-environment: ...@@ -35,11 +35,11 @@ deploy-build-environment:
- oc create -f simplejob.yml - oc create -f simplejob.yml
# wait for job to finish https://stackoverflow.com/questions/5073453wait-for-kubernetes-job-to-complete-on-either-failure-success-using-command-line # wait for job to finish https://stackoverflow.com/questions/5073453wait-for-kubernetes-job-to-complete-on-either-failure-success-using-command-line
- oc get job/simplejob${CI_PIPELINE_ID} -o=jsonpath='{.status}' -w && oc get job/simplejob${CI_PIPELINE_ID} -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo 'Failed' - oc get job/simplejob${CI_PIPELINE_ID} -o=jsonpath='{.status}' -w && oc get job/simplejob${CI_PIPELINE_ID} -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo 'Failed'
- while true; do x=$(oc get pods |grep simplejob${CI_PIPELINE_ID}|awk '{ print $3}');if [ $x != "Running" ]; then break; fi;done - while true; do x=$(oc get pods |grep simplejob${CI_PIPELINE_ID}|awk '{ print $3}');if [ $x != "Running" ]; then break; fi; sleep 10; done
# when build job finishes get the logs # when build job finishes get the logs
- oc logs jobs/simplejob${CI_PIPELINE_ID} | tee log.txt - oc logs jobs/simplejob${CI_PIPELINE_ID} | tee log.txt
# if spack install has failed, fail the pipeline # if spack install has failed, fail the pipeline
- if [ $(cat log.txt |grep ""|wc -l) -gt 1 ]; then exit 1;fi; - if [ $(cat log.txt |grep "Error:"|wc -l) -gt 1 ]; then exit 1;fi;
# delete the job from OpenShift as we have the logs here # delete the job from OpenShift as we have the logs here
#- oc delete job simplejob${CI_PIPELINE_ID} || true #- oc delete job simplejob${CI_PIPELINE_ID} || true
tags: tags:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment