-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
#/usr/bin/env bash | ||
#!/usr/bin/env bash | ||
|
||
# bump_version.sh (show|major|minor|patch|prerelease|build) | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
VERSION_FILE=trustymail/__init__.py | ||
|
||
HELP_INFORMATION="bump_version.sh (show|major|minor|patch|prerelease|build|finalize)" | ||
|
||
old_version=$(sed -n "s/^__version__ = '\(.*\)'$/\1/p" $VERSION_FILE) | ||
|
||
if [[ $# -ne 1 ]] | ||
if [ $# -ne 1 ] | ||
then | ||
echo $HELP_INFORMATION | ||
echo "$HELP_INFORMATION" | ||
else | ||
case $1 in | ||
major|minor|patch|prerelease|build) | ||
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))") | ||
echo Changing version from $old_version to $new_version | ||
echo Changing version from "$old_version" to "$new_version" | ||
sed -i "s/$old_version/$new_version/" $VERSION_FILE | ||
git add $VERSION_FILE | ||
git commit -m"Bumped version from $old_version to $new_version" | ||
git commit -m"Bump version from $old_version to $new_version" | ||
git push | ||
;; | ||
finalize) | ||
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))") | ||
echo Changing version from $old_version to $new_version | ||
echo Changing version from "$old_version" to "$new_version" | ||
sed -i "s/$old_version/$new_version/" $VERSION_FILE | ||
git add $VERSION_FILE | ||
git commit -m"Bumped version from $old_version to $new_version" | ||
git commit -m"Finalize version from $old_version to $new_version" | ||
git push | ||
;; | ||
show) | ||
echo $old_version | ||
echo "$old_version" | ||
;; | ||
*) | ||
echo $HELP_INFORMATION | ||
echo "$HELP_INFORMATION" | ||
;; | ||
esac | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
version=$(./bump_version.sh show) | ||
|
||
git tag v$version && git push --tags | ||
git tag "v$version" && git push --tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
version=$(./bump_version.sh show) | ||
docker build -t ${IMAGE_NAME}:$version . | ||
docker build -t "$IMAGE_NAME":"$version" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
echo "$DOCKER_PW" | docker login -u "$DOCKER_USER" --password-stdin | ||
version=$(./bump_version.sh show) | ||
docker push "$IMAGE_NAME":$version | ||
docker push "$IMAGE_NAME":"$version" |