#184 - Improvements to new issue branch script

Removed the offline mode for the issue branch. If dependencies are missing it won't work offline either. Rename it to drop the .sh suffix. That way, we can change its language in the future without user having to know.

Original pull request: #185.
This commit is contained in:
Greg Turnquist
2015-07-07 13:04:24 -05:00
committed by Oliver Gierke
parent 0ffb2b3c40
commit 04ac2a7f7b
2 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ target
.settings/
.project
.classpath
.idea

View File

@@ -2,12 +2,16 @@
#
# This script creates a new local issue branch for the given issue id.
# Previous changes are stashed before the issue branch is created and are reapplied after branch creation.
#
# executing new-issue-branch.sh DATACMNS-42
#
# executing new-issue-branch.sh DATACMNS-42
# will create a new (local) branch issue/DATACMNS-42
USAGE="$0 <ticket_id>"
if [ $# -lt 1 ]; then echo -e "ERROR: ticket_id required. \n$USAGE" >&2; exit 1; fi
if [ $# -gt 1 ]; then echo -e "ERROR: One argument maximum.\n$USAGE" >&2; exit 1; fi
TICKET_ID=${1:?"TICKET_ID Parameter is missing!"}
OLD_VERSION_TMP=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '^\[.*')
OLD_VERSION_TMP=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '^\[.*')
OLD_POM_VERSION=${OLD_VERSION_TMP:?"Could not extract current project version from pom.xml"}
@@ -19,7 +23,7 @@ echo "Creating feature branch $TICKET_ID: $OLD_POM_VERSION -> $NEW_POM_VERSION"
echo "Stashing potential intermediate changes..." && git stash\
&& git checkout -b $ISSUE_BRANCH\
&& mvn -o -q versions:set -DgenerateBackupPoms=false -DnewVersion=$NEW_POM_VERSION\
&& $(mvn $MAVEN_FLAGS -q versions:set -DgenerateBackupPoms=false -DnewVersion=$NEW_POM_VERSION)\
&& ( \
(\
git commit -am "$TICKET_ID - Prepare branch"\