Skip to content

Commit 35bdc36

Browse files
authored
Gitlab CI: Simplify status checker sleep logic (#4793)
Simply check every 15 minutes and let it timeout when it reaches the limit set by GitHub (6 hours).
1 parent 292e9ab commit 35bdc36

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

.github/workflows/trigger-hpsf-gitlab-ci.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,8 @@ jobs:
8484
echo "Waiting on GitLab pipeline $PIPELINE_ID..."
8585
8686
STATUS="running"
87-
MAX_WAIT=86400 # 24 hours
88-
ELAPSED=0
89-
9087
while [[ "$STATUS" == "running" || "$STATUS" == "pending" ]]; do
91-
if [ $ELAPSED -ge $MAX_WAIT ]; then
92-
echo "Timeout waiting for pipeline after $MAX_WAIT seconds"
93-
echo "final_status=timeout" >> $GITHUB_OUTPUT
94-
exit 1
95-
fi
96-
97-
if [ $ELAPSED -lt 7200 ]; then
98-
SLEEP_TIME=600 # 10 minutes
99-
else
100-
SLEEP_TIME=3600 # 1 hour
101-
fi
102-
sleep $SLEEP_TIME
103-
ELAPSED=$((ELAPSED + SLEEP_TIME))
88+
sleep 900 # 15 minutes
10489
10590
STATUS=$(curl -s \
10691
"https://gitlab.spack.io/api/v4/projects/${{ env.GITLAB_PROJECT_ID }}/pipelines/$PIPELINE_ID" \

0 commit comments

Comments
 (0)