File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,16 @@ counter=0
1313
1414# Wait up to 25 minutes for job to finish. A job can run on multiple nodes: parallelism > 1
1515while [ " $counter " -le 1500 ]; do
16- # Find number of nodes in running or queued
17- build_detail =$( curl -s " https://circleci.com/api/v2/project/github/DataBiosphere/terra-ui/job/$CIRCLE_BUILD_NUM " )
16+ # Find number of nodes in running
17+ job_detail =$( curl -s " https://circleci.com/api/v2/project/github/DataBiosphere/terra-ui/job/$CIRCLE_BUILD_NUM " )
1818
19- running_vm=$( echo " $build_detail " | jq -r --arg INDX " $CIRCLE_NODE_INDEX " ' .parallel_runs[] | select(.status=="running") | select(.index|tostring!=$INDX)' )
19+ # First, check the response for valid job json
20+ runs=$( echo " $job_detail " | jq -r ' .parallel_runs[]' )
21+ running_vm=$( echo " $runs " | jq -r ' select(.status=="running")' )
2022 count=$( echo " $running_vm " | grep -c -e " running" || test $? = 1; )
2123 if [ " $count " -eq 0 ]; then
2224 echo " Parallel runs have finished. Exiting wait-for-job-finish script."
25+ echo " $runs "
2326 exit 0
2427 fi
2528
You can’t perform that action at this time.
0 commit comments