Created
June 24, 2011 00:25
-
-
Save searls/1043970 to your computer and use it in GitHub Desktop.
My approximation of nvie's git flow when using maven-release-plugin to cut releases. - http://nvie.com/posts/a-successful-git-branching-model/
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
# How to perform a release with git & maven following the git flow conventions | |
# ---------------------------------------------------------------------------- | |
# Finding the next version: you can see the next version by looking at the | |
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate, | |
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would | |
# perform the release for version "0.0.2" and increment the development version | |
# of each project to "0.0.3-SNAPSHOT". | |
# branch from develop to a new release branch | |
git checkout develop | |
git checkout -b release/v0.0.2 | |
# perform a maven release, which will tag this branch and deploy artifacts to | |
# nexus (currently: http://10.202.4.52:8081/nexus ) | |
mvn release:prepare | |
mvn release:perform | |
# merge the version changes back into develop so that folks are working against | |
# the new release ("0.0.3-SNAPSHOT", in this case) | |
git checkout develop | |
git merge --no-ff release/v0.0.2 | |
# housekeeping -- rewind the release branch by one commit to fix its version at "0.0.2" | |
# excuse the force push, it's because maven will have already pushed '0.0.3-SNAPSHOT' | |
# to origin with this branch, and I don't want that version (or a diverging revert commit) | |
# in the release or master branches. | |
git checkout release/v0.0.2 | |
git reset --hard HEAD~1 | |
git push --force origin release/v0.0.2 | |
git checkout develop | |
# finally, if & when the code gets deployed to production | |
git checkout master | |
git merge --no-ff release/v0.0.2 | |
git branch -d release/v0.0.2 |
Neat! I haven't needed this gist in a long time, but I'm glad it inspired
you to run with it. :-)
…On Mon, Jul 23, 2012 at 6:12 AM, Vincent Demeester < ***@***.*** > wrote:
Hi, cool stuff. I did a few _changes_ in this workflow. I posted about it
there : http://vincent.demeester.fr/2012/07/maven-release-gitflow/
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1043970
I created one based on yours. SHare
https://gist.github.com/regis-leray/5969197
jgitflow looks promising : http://blogs.atlassian.com/2013/05/maven-git-flow-plugin-for-better-releases/ .
I've created a script based on the instructions outlined by @vdemeester here: http://vincent.demeester.fr/2012/07/maven-release-gitflow/
It's fairly straightforward: https://gist.github.com/nwinkler/9213085
The jgitflow plugin looks nice indeed, but only works well when using SSH keys to access the repo. Since I can't do that in our current setup, I can't use the jgitflow plugin - it keeps asking for username/password on the command line. Due to that, it isn't easy to use in a scripted solution.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, cool stuff. I did a few changes in this workflow. I posted about it there : http://vincent.demeester.fr/2012/07/maven-release-gitflow/