Unverified Commit b9eb9bec authored by Michael Müller's avatar Michael Müller Committed by GitHub
Browse files

Fix script which triggers downstream pipelines (#929)

* Exit with 1 in case of timeout

* Increase timeout to 1h, make configuration easier

* Echo timeout
parent 41b0a1c0
Pipeline #158414 passed with stages
in 28 minutes and 25 seconds
......@@ -43,7 +43,14 @@ function get_status() {
echo "Waiting on ${PIPELINE_ID} status..."
for i in $(seq 1 360); do
# How long to sleep in between polling the pipeline status.
POLL_SLEEP=5
# Time until the script exits with 1, if the pipeline isn't finished until then.
TIMEOUT_MINUTES=60
SEQ_END=$(( (TIMEOUT_MINUTES * 60) / POLL_SLEEP ))
for i in $(seq 1 $SEQ_END); do
STATUS=$(get_status);
echo "Triggered pipeline status is ${STATUS}";
if [[ ${STATUS} =~ ^(pending|running|created)$ ]]; then
......@@ -57,3 +64,6 @@ for i in $(seq 1 360); do
fi
sleep 5;
done
echo "Timeout! The pipeline didn't return in time."
exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment