Skip to content
Permalink
Browse files

Add bump_version.sh script

  • Loading branch information...
philngo committed Jan 3, 2019
1 parent 8fb6c04 commit ebba44922d703d516b2d5449090f889757158961
Showing with 49 additions and 0 deletions.
  1. +3 −0 CONTRIBUTING.md
  2. +46 −0 bump_version.sh
@@ -50,6 +50,9 @@ git merge release/vX.X.X
git push
```

Or, use the `./bump_version.sh X.X.X Y.Y.Y` command to generate some more
specific commands.

Updating the internal db
------------------------

@@ -0,0 +1,46 @@
#!/bin/bash

####################################
# #
# Prints commands necessary to #
# do a version bump. Usage: #
# #
# ./bump_version.sh X.X.X Y.Y.Y #
# #
# where X.X.X is the old version #
# and X.X.X is the new version #
# #
####################################

set -e # fail script on any error, show commands

OLD_VERSION=$1 # e.g., 0.0.0
NEW_VERSION=$2 # e.g., 0.0.1
NEW_VERSION_LENGTH=$(printf "%s" "$NEW_VERSION" | wc -c)
DASHES=$(printf "%${NEW_VERSION_LENGTH}s" | sed 's/ /-/g')

echo "git checkout master"
echo "git pull"
echo "git checkout -b release/v${NEW_VERSION}"
echo ""
echo "sed -i -e 's/${OLD_VERSION}/${NEW_VERSION}/g' eeweather/__version__.py"
echo "sed -i -e '/Development/,/-----------/ c\\
Development\\
-----------\\
\\
* Placeholder\\
\\
${NEW_VERSION}\\
${DASHES}\\
' CHANGELOG.md"
echo "rm -f eeweather/__version__.py-e"
echo "rm -f CHANGELOG.md-e"
echo ""
echo "git commit -am \"Bump version\""
echo "git tag v${NEW_VERSION}"
echo "git push -u origin release/v${NEW_VERSION} --tags"
echo "docker-compose run --rm pipenv run python setup.py upload"
echo "git checkout master"
echo "git pull"
echo "git merge release/v${NEW_VERSION}"
echo "git push"

0 comments on commit ebba449

Please sign in to comment.
You can’t perform that action at this time.