From e7af9684fab813799669d6284f5d18784a6960c5 Mon Sep 17 00:00:00 2001 From: Jason Vanderhoof Date: Mon, 23 Mar 2020 14:12:57 -0600 Subject: [PATCH] v1.5.0 --- CHANGELOG.md | 1 - release | 47 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1962ca556..28a609406c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/release b/release index cd0c1abcb6..3f7d566817 100755 --- a/release +++ b/release @@ -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" @@ -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