File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 22
33set -u
44
5+ DEFAULT_POLL_TIMEOUT=10
6+ POLL_TIMEOUT=${POLL_TIMEOUT:- $DEFAULT_POLL_TIMEOUT }
7+
58git checkout " ${GITHUB_REF: 11} "
69
710branch=$( git symbolic-ref --short HEAD)
@@ -13,15 +16,19 @@ sh -c "git remote add mirror $*"
1316sh -c " echo pushing to $branch branch at $( git remote get-url --push mirror) "
1417sh -c " git push mirror $branch "
1518
16- sleep 5s
19+ sleep $POLL_TIMEOUT
1720
1821pipeline_id=$( curl --header " PRIVATE-TOKEN: $GITLAB_PASSWORD " " https://${GITLAB_HOSTNAME} /api/v4/projects/${GITLAB_PROJECT_ID} /repository/commits/${branch} " | jq ' .last_pipeline.id' )
1922
23+ echo " Triggered CI for branch $branch }"
24+ echo " Working with pipeline id #${pipeline_id} "
25+ echo " Poll timeout set to ${POLL_TIMEOUT}
26+
2027ci_status=" pending"
2128
2229until [[ " $ci_status " != " pending" && " $ci_status " != " running" ]]
2330do
24- sleep 5s
31+ sleep $POLL_TIMEOUT
2532 ci_output=$( curl --header " PRIVATE-TOKEN: $GITLAB_PASSWORD " " https://${GITLAB_HOSTNAME} /api/v4/projects/${GITLAB_PROJECT_ID} /pipelines/${pipeline_id} " )
2633 ci_status=$( jq -n " $ci_output " | jq -r .status)
2734 ci_web_url=$( jq -n " $ci_output " | jq -r .web_url)
You can’t perform that action at this time.
0 commit comments