Created
March 21, 2014 21:00
-
-
Save talios/9696405 to your computer and use it in GitHub Desktop.
Git command to wrap handling Apache Maven Releases with GitFlow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if ! git diff-index --quiet HEAD --; then | |
echo "Git is dirty, clean up your mess!" | |
exit 1 | |
fi | |
VERSION=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" pom.xml` | |
BASEVERSION=${VERSION%-SNAPSHOT} | |
ARTIFACTID=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:artifactId" pom.xml` | |
echo "Removing non-scm files..." | |
git clean -fdi | |
echo "Checking master branch for updates..." | |
git fetch origin master | |
git flow release start $BASEVERSION && mvn release:prepare release:perform -Psonatype && git flow release finish $BASEVERSION && git push && git push --tags && git push gerrit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment