Skip to content

Commit 2ad704c

Browse files
authored
fix: correct the reporting of the service check build CI job (#932)
1 parent a4c504e commit 2ad704c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/scripts/run-codebuild-batch-job.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ echo "Build id $BUILD_ID"
3333

3434
BUILD_STATUS="IN_PROGRESS"
3535
while [ "$BUILD_STATUS" == "IN_PROGRESS" ]; do
36-
echo "Checking build status."
36+
sleep 10
37+
3738
BUILD=$(aws codebuild batch-get-build-batches --ids ${BUILD_ID})
3839
BUILD_STATUS=$(echo $BUILD | jq '.buildBatches[0].buildBatchStatus' -r)
3940

40-
JOBS=$(echo $BUILD | jq '.buildBatches[0].buildGroups | [.[] | {identifier: .identifier, status: .currentBuildSummary.buildStatus} | select(.identifier | startswith("JOB"))]')
41+
JOBS=$(echo $BUILD | jq '.buildBatches[0].buildGroups | [.[] | { identifier: .identifier, status: .currentBuildSummary.buildStatus } ]')
4142
TOTAL_JOBS=$(echo $JOBS | jq 'length')
4243

4344
SUCCEEDED_CNT=$(echo $JOBS | jq '[.[] | select(.status == "SUCCEEDED")] | length')
@@ -47,9 +48,7 @@ while [ "$BUILD_STATUS" == "IN_PROGRESS" ]; do
4748

4849
if [ "$BUILD_STATUS" == "IN_PROGRESS" ]; then
4950
echo "Build is still in progress (failed=$FAILED_CNT; in_progress=$IN_PROGRESS_CNT; succeeded=$SUCCEEDED_CNT; total=$TOTAL_JOBS), waiting..."
50-
5151
fi
52-
sleep 10
5352
done
5453

5554
if [ "$BUILD_STATUS" != "SUCCEEDED" ]; then

0 commit comments

Comments
 (0)