Skip to content

Instantly share code, notes, and snippets.

@bitwiseman
Forked from jglick/backport.sh
Created February 1, 2021 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitwiseman/f22ce7086957993c9f96a0e065fb1712 to your computer and use it in GitHub Desktop.
Save bitwiseman/f22ce7086957993c9f96a0e065fb1712 to your computer and use it in GitHub Desktop.
Example of setting up a Jenkins plugin backport branch
export BASE=1.19 # or whatever; last release compatible with targeted core or other deps
export BASETAG=mystuff-${BASE} # or as per http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#tagNameFormat
export FIX=abcd1234 # whatever the backportable fix was, in master or somewhere newer than $BASE
git checkout -b ${BASE}.x $(git log --reverse --ancestry-path --pretty=%H ${BASETAG}..master | head -1)
# or for JEP-305 use: mvn versions:set-property -Dproperty=revision -DnewVersion=${BASE}.1
mvn versions:set -DnewVersion=${BASE}.1-SNAPSHOT
git commit -a -m "Prepare for ${BASE}.1"
git push -u origin ${BASE}.x
git cherry-pick -x -m1 $FIX
mvn -B release:{prepare,perform}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment