diff --git a/.gitignore b/.gitignore index 5fbc110c..a17c04e3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ target .settings/ .project .classpath +.idea diff --git a/etc/scripts/new-issue-branch.sh b/etc/scripts/new-issue-branch similarity index 67% rename from etc/scripts/new-issue-branch.sh rename to etc/scripts/new-issue-branch index 6bc1bde0..323dcc51 100755 --- a/etc/scripts/new-issue-branch.sh +++ b/etc/scripts/new-issue-branch @@ -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 " +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"\