Skip to content

Commit

Permalink
Clean before deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
JrGoodle committed May 7, 2020
1 parent a854669 commit af88980
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion script/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af88980

Please sign in to comment.