Skip to content

Commit c074db5

Browse files
author
Matthew Fisher
committed
Merge pull request #3855 from Joshua-Anderson/retry-docker-hub
feat(tests): retry push to dockerhub
2 parents ece7545 + 2e66655 commit c074db5

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

tests/bin/test-integration-ec2.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,33 @@ log_phase "etcd available after $WAIT_TIME seconds"
123123

124124
log_phase "Publishing release from source tree"
125125

126-
# TODO: detect where IMAGE_PREFIX=deis/ and DEV_REGISTRY=registry.hub.docker.com
127-
# and disallow it so we can't pollute the production account.
128-
make dev-release
126+
set +e
127+
trap - ERR
128+
129+
RETRY_COUNT=1
130+
131+
while [ $RETRY_COUNT -le 3 ]; do
132+
# TODO: detect where IMAGE_PREFIX=deis/ and DEV_REGISTRY=registry.hub.docker.com
133+
# and disallow it so we can't pollute the production account.
134+
make dev-release
135+
RESULT=$?
136+
137+
if [ $RESULT -ne 0 ]; then
138+
echo "Docker Hub push failed. Attempt $RETRY_COUNT of 3."
139+
else
140+
break
141+
fi
142+
143+
(( RETRY_COUNT += 1 ))
144+
done
145+
146+
set -e
147+
trap dump_logs ERR
148+
149+
if [ $RETRY_COUNT -gt 3 ]; then
150+
echo "Docker Hub push failed the maximum number of times, aborting."
151+
false
152+
fi
129153

130154
log_phase "Provisioning Deis"
131155

0 commit comments

Comments
 (0)