chore: switched to a using a go template for job status

This commit is contained in:
2023-09-28 16:14:22 -06:00
parent f67a371ea0
commit 1e9cf4655e

View File

@@ -339,10 +339,10 @@ spec:
EOF
MYJOB=$(oc -n $(tasks.ephemeral-ns.results.namespace) get jobs -l app=e2e-test -o name)
echo "Job Reference: ${MYJOB}"
x=0; until [[ -n $(oc -n $(tasks.ephemeral-ns.results.namespace) get ${MYJOB} -o jsonpath="{.status.active}") -gt 0 || $x -eq 60 ]]; do echo "Waiting for e2e job to start" && sleep 2 && ((x++)); done
x=0; until [[ $(oc -n $(tasks.ephemeral-ns.results.namespace) get ${MYJOB} -o go-template="{{if .status.active}}{{.status.active}}{{else}}0{{end}}") -gt 0 || $x -eq 60 ]]; do echo "Waiting for e2e job to start" && sleep 2 && ((x++)); done
if [[ "${x}" -eq 60 ]]; then exit 1; fi
x=0; until [[ $(oc -n $(tasks.ephemeral-ns.results.namespace) get ${MYJOB} -o jsonpath="{.status.succeeded}") -gt 0 || $x -eq 20 ]]; do echo "Waiting for test to complete" && sleep 15 && ((x++)); done
x=0; until [[ $(oc -n $(tasks.ephemeral-ns.results.namespace) get ${MYJOB} -o go-template="{{if .status.succeeded}}{{.status.succeeded}}{{else}}0{{end}}" ) -gt 0 || $x -eq 20 ]]; do echo "Waiting for test to complete" && sleep 15 && ((x++)); done
if [[ "${x}" -eq 20 ]]; then exit 1; fi
workspaces:
- name: kubeconfig-dir