-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprepare_rel_version.sh
More file actions
executable file
·54 lines (43 loc) · 886 Bytes
/
prepare_rel_version.sh
File metadata and controls
executable file
·54 lines (43 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
set -euxo pipefail
# preflight checks
case "$1" in
"-p")
echo "Product Release Preparation"
target="pom-redhat.xml"
;;
"-c")
echo "Community Release Preparation"
target="pom.xml"
;;
*)
echo "Usage: prepare_rel_version.sh <-p|-c>"
exit 1
;;
esac
if [ -e "$target" ]; then
echo "Target $target"
else
echo "File $target does not exist, exiting."
exit 0
fi
version=`../current_version.sh $1`
cleaned_version=`echo $version | sed -e 's/[^0-9][^0-9]*$//'`
echo $cleaned_version
# move pom.xml around
case "$1" in
"-p")
rm -f pom.xml
mv pom-redhat.xml pom.xml
;;
"-c")
rm -f pom-redhat.xml
;;
esac
# update version
mvn versions:set -DnewVersion=$cleaned_version
# perform tests
mvn clean install
git commit -a -m "Prepare for release $cleaned_version"
git tag $cleaned_version
git log --oneline -n 3