Skip to content
Snippets Groups Projects
Verified Commit 79fd20df authored by Alex Iribarren's avatar Alex Iribarren
Browse files

Retry with retry

parent 600edc58
No related branches found
No related tags found
1 merge request!70Retry builds up to 3 times
......@@ -14,22 +14,7 @@ stages:
}
.common_script: &common_script |
COUNT=0
set +e
while [[ $COUNT -lt 3 ]]; do
oc start-build linux-docs --wait
RET=$?
if [[ $RET -eq 0 ]]; then
break
fi
COUNT=$(($COUNT+1))
sleep 30s
done
set -e
if [[ $RET -ne 0 ]]; then
echo "Failed to build docs"
exit 1
fi
oc start-build linux-docs --wait
build_test:
stage: build
......@@ -42,6 +27,7 @@ build_test:
# Use double quotes so variable interpolation works, but this requires scaping JSON patch
- oc patch buildconfig linux-docs -p "{\"spec\":{\"source\":{\"git\":{\"ref\":\"$CI_COMMIT_REF_NAME\"}}}}"
- *common_script
retry: 3
except:
- master
variables:
......@@ -55,6 +41,7 @@ build_prod:
- *common_functions
script:
- *common_script
retry: 3
variables:
<<: *prod_variables
only:
......@@ -72,6 +59,7 @@ sync test with prod:
# Use double quotes so variable interpolation works, but this requires scaping JSON patch
- oc patch buildconfig linux-docs -p "{\"spec\":{\"source\":{\"git\":{\"ref\":\"$CI_COMMIT_REF_NAME\"}}}}"
- *common_script
retry: 3
only:
- master
variables:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment