From af8898009695623edb88adb5bf4858b4ff36e4b1 Mon Sep 17 00:00:00 2001 From: Joe DeCapo Date: Thu, 7 May 2020 18:38:57 -0500 Subject: [PATCH] Clean before deploying --- script/deploy | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/script/deploy b/script/deploy index ea03fb145..4796e3e48 100755 --- a/script/deploy +++ b/script/deploy @@ -16,25 +16,35 @@ fi export GITHUB_USER='JrGoodle' export GITHUB_REPO='clowder' -pushd "src" || exit 1 +pushd 'src' || exit 1 SETUP_PY="$(pwd)/setup.py" VERSION=$(awk "/version='/" "${SETUP_PY}" | sed -n -e "s/^.*version='//p" | tr -d "',") echo "VERSION=${VERSION}" TAG="${VERSION}" +popd || exit 1 + git fetch --tags if git rev-list "${TAG}" >/dev/null; then echo "${TAG} tag exists. No deployment will be done." else echo "${TAG} tag not found. Deploying..." + echo 'Clean any existing build artifacts' + echo '----------------------------------' + script/clean all || exit 1 + echo '' + echo 'Create tag and push to GitHub' echo '-----------------------------' git tag "${TAG}" -a -m "${TAG}" git push origin "${TAG}" echo '' + pushd 'src' || exit 1 + echo '' + echo 'Create source distribution' echo '--------------------------' sudo -H python3 setup.py sdist || exit 1