Skip to content

Commit 2ba3ba5

Browse files
author
Your Name
committed
Merge rc to develop when creating hotfix release
1 parent 7dc3963 commit 2ba3ba5

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

create_release.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ set -xe
88
# 1. create temporary release branch with name release/$RELEASE_VERSION
99
# 2. bump version to $RELEASE_VERSION
1010
# 3. commit to release branch, then merge it into master
11-
# 4. merge release into develop, with expected develop version
12-
# 5. merge release into rc, with expected rc version (only if releasing from hotfix)
11+
# 4. merge release into rc, with expected rc version (only if releasing from hotfix)
12+
# 5. merge release (with changes to rc) into develop, with expected develop version
1313
# 6. delete temporary release branch
1414
# 7. create hotfix branch from master
1515

@@ -47,21 +47,24 @@ commit_changes "$(create_release_message)"
4747
merge_release_branch_to "master"
4848
tag_and_push_master
4949
# 4.
50-
git checkout $RELEASE_BRANCH
51-
io_from_release_to_snapshot $EXPECTED_DEVELOP_VERSION
52-
commit_changes "$(bump_to_message $EXPECTED_DEVELOP_VERSION)"
53-
merge_release_branch_to "develop"
54-
push origin develop
55-
# 5.
5650
if [ $SOURCE_BRANCH != "rc" ] ; then
5751
git checkout $RELEASE_BRANCH
58-
# clean bumping commit from $RELEASE BRANCH
59-
git reset --hard HEAD~1
60-
io_from_release_to_snapshot $EXPECTED_RC_VERSION
52+
modify_version $RELEASE_VERSION "0" ${EXPECTED_RC_VERSION%-SNAPSHOT} "SNAPSHOT"
6153
commit_changes "$(bump_to_message $EXPECTED_RC_VERSION)"
6254
merge_release_branch_to "rc"
6355
push origin rc
6456
fi
57+
# 5.
58+
git checkout $RELEASE_BRANCH
59+
if [ $SOURCE_BRANCH != "rc" ] ; then
60+
# rc version should be expected
61+
modify_version ${EXPECTED_RC_VERSION%-SNAPSHOT} "SNAPSHOT" ${EXPECTED_DEVELOP_VERSION%-SNAPSHOT} "SNAPSHOT"
62+
else
63+
modify_version $RELEASE_VERSION "0" ${EXPECTED_DEVELOP_VERSION%-SNAPSHOT} "SNAPSHOT"
64+
fi
65+
commit_changes "$(bump_to_message $EXPECTED_DEVELOP_VERSION)"
66+
merge_release_branch_to "develop"
67+
push origin develop
6568
# 6.
6669
git branch -d $RELEASE_BRANCH
6770
# 7.

io_changes.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ function io_create_release {
99
_modify_version ${EXPECTED_CURRENT_VERSION%-SNAPSHOT} "SNAPSHOT" $RELEASE_VERSION "0"
1010
}
1111

12-
function io_from_release_to_snapshot {
13-
local future_snapshot_version=$1
14-
assert_current_branch_name $RELEASE_BRANCH
15-
assert_version_ends_with $RELEASE_VERSION "0"
16-
assert_version_ends_with $future_snapshot_version "SNAPSHOT"
17-
18-
_modify_version $RELEASE_VERSION "0" ${future_snapshot_version%-SNAPSHOT} "SNAPSHOT"
12+
function modify_version {
13+
local expected_version_core=$1
14+
local expected_rpm_release=$2 # SNAPSHOT or 0
15+
local future_version_core=$3
16+
local future_rpm_release=$4 # SNAPSHOT or 0
17+
_modify_version $expected_version_core $expected_rpm_release $future_version_core $future_rpm_release
1918
}
2019

2120
function io_hotfix_changes {

0 commit comments

Comments
 (0)