Skip to content

Commit ecdda6a

Browse files
committed
Update release script
1 parent e7ee9ee commit ecdda6a

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

do-release.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ if [ ! -f pom.xml ] || [ ! -d ${PMD_GITHUB_IO_DIR} ]; then
1717
fi
1818

1919
RELEASE_VERSION=
20-
DEVELOPMENT_VERSION=
2120
CURRENT_BRANCH=
2221

2322
echo "-------------------------------------------"
@@ -37,30 +36,37 @@ else
3736
NEXT_MINOR="${MINOR}"
3837
NEXT_PATCH=$(("${PATCH}" + 1))
3938
fi
40-
DEVELOPMENT_VERSION="$MAJOR.$NEXT_MINOR.$NEXT_PATCH"
41-
DEVELOPMENT_VERSION="${DEVELOPMENT_VERSION}"
4239

43-
# allow to override the next version, e.g. via "NEXT_VERSION=7.0.0 ./do-release.sh"
44-
if [ "$NEXT_VERSION" != "" ]; then
45-
DEVELOPMENT_VERSION="${NEXT_VERSION}"
40+
# allow to override the next version, e.g. via "DEVELOPMENT_VERSION=7.0.0-SNAPSHOT ./do-release.sh"
41+
if [ "$DEVELOPMENT_VERSION" = "" ]; then
42+
DEVELOPMENT_VERSION="$MAJOR.$NEXT_MINOR.$NEXT_PATCH-SNAPSHOT"
43+
fi
44+
45+
# allow to override the build qualifier, e.g. via "BUILDQUALIFIER="$(date -u +v%Y%m%d-%H%M)-rc1" ./do-release.sh"
46+
if [ "$BUILDQUALIFIER" = "" ]; then
47+
# Pick a release BUILDQUALIFIER (e.g. v20170401-0001-r) and update versions
48+
# E.g. version is: "4.0.13" and BUILDQUALIFIER is "v20170401-0001-r".
49+
# The complete version of the plugin will be "4.0.13.v20170401-0001-r
50+
BUILDQUALIFIER="$(date -u +v%Y%m%d-%H%M)-r"
4651
fi
4752

4853
# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
4954
CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
5055
CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
5156
CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
5257

53-
# Pick a release BUILDQUALIFIER (e.g. v20170401-0001-r) and update versions
54-
# E.g. version is: "4.0.13" and BUILDQUALIFIER is "v20170401-0001-r".
55-
# The complete version of the plugin will be "4.0.13.v20170401-0001-r
56-
BUILDQUALIFIER="$(date -u +v%Y%m%d-%H%M)-r"
58+
export DEVELOPMENT_VERSION
5759
export BUILDQUALIFIER
5860

5961
echo "RELEASE_VERSION: ${RELEASE_VERSION}.${BUILDQUALIFIER} (this release)"
6062
echo "DEVELOPMENT_VERSION: ${DEVELOPMENT_VERSION} (the next version after the release)"
6163
echo "CURRENT_BRANCH: ${CURRENT_BRANCH}"
6264

63-
65+
echo
66+
echo "Is this correct?"
67+
echo
68+
echo "Press enter to continue... (or CTRL+C to cancel)"
69+
read -r
6470

6571
echo Update the ReleaseNotes with the release date and version:
6672
echo

0 commit comments

Comments
 (0)