1
1
#! /bin/bash
2
2
3
- # This script simulates the Maven Release Plugin, but only performs release:clean and
4
- # release:prepare. The release:perform step is handled by the CI when the tag is
5
- # pushed.
3
+ # This script simulates the Maven Release Plugin, but only performs
4
+ # release:clean and release: prepare. The release:perform step is handled by the
5
+ # CI when the tag is pushed.
6
6
#
7
7
# However, release:perform on Git requires the release.properties file. We must
8
- # therefore modify the first commit created by release:prepare to include this file, and
9
- # then delete the file in the second commit.
8
+ # therefore modify the first commit created by release:prepare to include this
9
+ # file, and then delete the file in the second commit.
10
10
#
11
- # This will ensure that release.properties is available to release:perform in the CI,
12
- # while keeping with the expectation that this file does not get commited (long-term) to
13
- # the repository.
11
+ # This will ensure that release.properties is available to release:perform in
12
+ # the CI, while keeping with the expectation that this file does not get
13
+ # commited (long-term) to the repository.
14
14
15
15
set -euo pipefail
16
16
@@ -21,7 +21,7 @@ set -euo pipefail
21
21
git reset HEAD~1
22
22
23
23
# delete tag created by release:prepare
24
- tag_name=$( git tag --points-at)
24
+ tag_name=" $( git tag --points-at) "
25
25
git tag -d " $tag_name "
26
26
27
27
# Add release.properties to that commit
@@ -31,7 +31,8 @@ git commit --amend --no-edit
31
31
# recreate tag
32
32
git tag " $tag_name " -m " [maven-release-plugin] copy for tag $tag_name "
33
33
34
- # Recreate second commit, removing release.properties from the repository
34
+ # Recreate second commit (from release to SNAPSHOT), removing
35
+ # release.properties from the repository
35
36
git rm release.properties
36
37
git add pom.xml
37
38
git commit -m " [maven-release-plugin] prepare for next development iteration"
@@ -40,4 +41,5 @@ git commit -m "[maven-release-plugin] prepare for next development iteration"
40
41
git push
41
42
git push origin " $tag_name "
42
43
44
+ # clean up
43
45
rm pom.xml.releaseBackup
0 commit comments