Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanderhoof committed Mar 23, 2020
1 parent c4bef10 commit e7af968
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix support for using deployment as K8s authentication resource type for Kubernetes >= 1.16
([#1440](https://github.com/cyberark/conjur/issues/1440))


## [1.4.7] - 2020-03-12

### Changed
Expand Down
47 changes: 36 additions & 11 deletions release
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/bin/bash -e

function print_help() {
cat << EOF
Creates an Appliance release
Usage: start [options]
-h, --help Shows this help message.
-r, --revert Removes the current version tags. This allows the appliance
to be re-released.
-f, --force Release even if there are no changes. This is necessary
after a revert.
EOF
}

function revert_tag {
local tag="$1"
echo "Revert tag: $tag"
Expand All @@ -10,35 +28,42 @@ function revert_tag {

git fetch --tags

if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "Must be on the master branch to releases. Please switch with 'git checkout master'."
exit 1
fi

version="v$(< VERSION)"
last_release=$(git describe --abbrev=0 --tags)

FORCE_RELEASE=false
while true ; do
case "$1" in
--revert ) revert_tag $version ; exit 0 ;;
-r | --revert ) revert_tag $version ; exit 0 ;;
-h | --help ) print_help ; exit 0 ;;
-f | --force ) FORCE_RELEASE=true ; shift ;;
* ) if [ -z "$1" ]; then break; else echo "$1 is not a valid option"; exit 1; fi;;
esac
done


echo "The last release was: $last_release"
echo "The next release will be: $version"

if [ "$version" = "$last_release" ]; then
echo 'To release, the VERSION file must be incremented to the latest release number.'
exit 1
fi

if [[ ! $(git status --porcelain) ]]; then
echo 'Your Git is clean. Please update the VERSION, CHANGELOG.md, and optionally RELEASE_NOTES.md before releasing. The script will handle commits and pushing.'
if [[ ! $(git status --porcelain) && $FORCE_RELEASE = false ]]; then
cat << EOF
Your Git is clean. Please update the VERSION, CHANGELOG.md, and optionally
RELEASE_NOTES.md before releasing. The script will handle commits and pushing.
If you reverted a release, and are simply updating tags, the force tag can be used:
release --force
EOF
exit 1
fi

echo "The last release was: $last_release"
echo "The next release will be: $version"

# Make sure we have the most recent changes, without destroying local changes.
git stash
git pull --rebase origin master
Expand Down

0 comments on commit e7af968

Please sign in to comment.