summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-08-09 17:28:35 -0700
committerJoffrey F <joffrey@docker.com>2018-08-09 17:28:35 -0700
commit87d72c0f6cf726764a1cf8aebc527c64d46cecfb (patch)
treeb97b8f19af682f0552fcee3a49cb9d760cc5ecb3
parent205a2f76bd7791dcef52e8b1f3acd9b95bc29ad3 (diff)
downloaddocker-py-87d72c0f6cf726764a1cf8aebc527c64d46cecfb.tar.gz
Misc release script improvements
Signed-off-by: Joffrey F <joffrey@docker.com>
-rwxr-xr-xscripts/release.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/scripts/release.sh b/scripts/release.sh
index f36efff..5b37b6d 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -22,7 +22,15 @@ echo "##> Removing stale build files"
rm -rf ./build || exit 1
echo "##> Tagging the release as $VERSION"
-git tag $VERSION || exit 1
+git tag $VERSION
+if [[ $? != 0 ]]; then
+ head_commit=$(git show --pretty=format:%H HEAD)
+ tag_commit=$(git show --pretty=format:%H $VERSION)
+ if [[ $head_commit != $tag_commit ]]; then
+ echo "ERROR: tag already exists, but isn't the current HEAD"
+ exit 1
+ fi
+fi
if [[ $2 == 'upload' ]]; then
echo "##> Pushing tag to github"
git push $GITHUB_REPO $VERSION || exit 1
@@ -30,10 +38,10 @@ fi
pandoc -f markdown -t rst README.md -o README.rst || exit 1
+echo "##> sdist & wheel"
+python setup.py sdist bdist_wheel
+
if [[ $2 == 'upload' ]]; then
- echo "##> Uploading sdist to pypi"
- python setup.py sdist bdist_wheel upload
-else
- echo "##> sdist & wheel"
- python setup.py sdist bdist_wheel
-fi
+ echo '##> Uploading sdist to pypi'
+ twine upload dist/docker-$VERSION*
+fi \ No newline at end of file