Check twine uploads for success

Twine occasionally hits 500 errors from pypi but that doesn't
necessarily mean that the upload failed. We can check if it succeeded
directly by requesting an HTTP HEAD against the resource path. Use the
result of this request to determine if we have failed.

Change-Id: I1f12c5c7b1bf0f556d10366336a471b81a6cc68c
This commit is contained in:
Clark Boylan 2016-02-02 14:47:59 -08:00
parent c3a8952dde
commit 16b12ba5b9
2 changed files with 8 additions and 2 deletions

View File

@ -33,4 +33,7 @@ curl --fail -o $FILENAME http://$TARBALL_SITE/$PROJECT/$FILENAME
# Make sure we actually got a gzipped file
file -b $FILENAME | grep gzip
twine upload -r pypi $FILENAME
# Uploads may claim to fail but actually succeed so we check if we
# can download after upload to determine success.
twine upload -r pypi $FILENAME || true
curl --head --silent --fail "https://pypi.python.org/simple/$PROJECT/$FILENAME" >/dev/null 2>&1

View File

@ -35,4 +35,7 @@ curl --fail -o $FILENAME http://$TARBALL_SITE/$PROJECT/$FILENAME
# Make sure we actually got a wheel
file -b $FILENAME | grep -i zip
twine upload -r pypi $FILENAME
# Uploads may claim to fail but actually succeed so we check if we
# can download after upload to determine success.
twine upload -r pypi $FILENAME || true
curl --head --silent --fail "https://pypi.python.org/simple/$PROJECT/$FILENAME" >/dev/null 2>&1