...
Check out the version of the codebase from which you start the release. For a new minor or major release, this may be HEAD
of the master
branch. To build a hotfix/incremental release, instead of the master
branch, use the release branch of the release being patched. (Please make sure your cloned repository is up-to-date before starting.)
Code Block |
---|
|
$ git checkout <master branch OR release tag> |
Set up a few environment variables to simplify Maven commands that follow. (We use bash
Unix syntax in this guide.)
Code Block |
---|
|
RELEASE_VERSION="1.24.30"
NEXTSHORT_RELEASE_VERSION="1.2.4"
BRANCHCURRENT_SNAPSHOT_NAMEVERSION="release-${VERSION}"
DEVELOPMENT$SHORT_RELEASE_VERSION-SNAPSHOT"
NEXT_SNAPSHOT_VERSION="${NEXT_VERSION}1.5-SNAPSHOT" |
Version represents the release currently underway, while next version specifies the anticipated next version to be released from that branch. Normally, 1.2.0 is followed by 1.3.0, while 1.2.3 is followed by 1.2.4.
Use Maven release plugin to create the release branch and update the current branch to use the new development version. This command applies for the new major or minor version. (Warning: this command automatically pushes changes to the code repository.)
Code Block |
---|
|
mvn release:branch \
-DbranchName=${BRANCH_NAME} \
-DdevelopmentVersion=${DEVELOPMENT_VERSION} |
Most of the following commands have to be executed in the tools
directory, we will prefix the command prompt to make this explicit.
If you are doing a new major release, first create a branch for the new version that we want to release before updating the master branch to the next development version:
Code Block |
---|
|
$ git checkout -b release-$SHORT_RELEASE_VERSION
$ git checkout master
$ cd tools
tools $ OLD_VERSION=$CURRENT_SNAPSHOT_VERSION NEW_VERSION=$NEXT_SNAPSHOT_VERSION releasing/update_branch_version.sh
$ cd ..
$ git checkout -b release-$SHORT_RELEASE_VERSION |
If you're creating a new minor release, you will skip the above step and simply check out the release branch
Code Block |
---|
|
$ git checkout -b release-$SHORT_RELEASE_VERSION |
Now, create a release branch:However, if you are doing an incremental/hotfix release, please run the following command after checking out the release tag of the release being patched.
Code Block |
---|
|
mvn release:branch \
-DbranchName=${BRANCH_NAME} \
-DupdateWorkingCopyVersions=false \
-DupdateBranchVersions=true \
-DreleaseVersion="${VERSION}-SNAPSHOT" |
...