try on fail

Signed-off-by: Jess Frazelle <me@jessfraz.com>
This commit is contained in:
Jess Frazelle 2016-06-08 12:46:38 -07:00
parent b3df40938f
commit dc070ecae4
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3

View File

@ -30,7 +30,15 @@ for f in "${files[@]}"; do
echo "Successfully built ${base}:${suite} with context ${build_dir}"
echo " --- "
docker push --disable-content-trust=false r.j3ss.co/${base}:${suite}
# try push a few times because notary server sometimes returns 401 for
# absolutely no reason
n=0
until [ $n -ge 5 ]; do
docker push --disable-content-trust=false r.j3ss.co/${base}:${suite} && break
echo "Try #$n failed... sleeping for 15 seconds"
n=$[$n+1]
sleep 15
done
# also push the tag latest for "stable" tags
if [[ "$suite" == "stable" ]]; then