forked from TechnologyBrewery/habushu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-habushu.sh
executable file
·77 lines (56 loc) · 2.77 KB
/
release-habushu.sh
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#This script requires two input parameter, 1)target release version 2)next development version.
#To run the script, enter a command like this: ./release-habushu.sh <target-release-version> <next-development-version>
#After the script is executed, navigate to github to create a PR to merge your release branch
#and validate that the released version of habushu-maven-plugin may be found in Maven Central
echo "////////////////////////////////////////////"
echo "//"
echo "// Use this script to run a release for Habushu"
echo "//"
echo "////////////////////////////////////////////"
echo "//////////// Check out a release branch ////////////"
git checkout -b $1-release
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Unable to check out release branch!'; exit 1
fi
echo "/////////// Check there are no uncommitted local changes ///////////"
mvn scm:check-local-modification
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Uncommitted local changes detected!'; exit 1
fi
echo "/////////// Update POM versions to the target release version ///////////"
mvn versions:set -DnewVersion=$1 -DgenerateBackupPoms=false
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Unable to update POM versions to the target release version'; exit 1
fi
echo "/////////// Rebuild Habushu modules ///////////"
mvn clean install -Pbootstrap -Dmaven.build.cache.enabled=false && mvn clean install -Dmaven.build.cache.enabled=false -Dhabushu.usePyenv=false
if [[ "$?" -ne 0 ]] ; then
echo 'Rebuilding Habushu failed!'; exit 1
fi
echo "/////////// Commit all changes that reflect the target release version and create a tag ///////////"
mvn scm:checkin -Dmessage="Prepare release habushu-$1"
mvn scm:tag -Dtag=habushu-$1
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Unable to commit changes and create a tag!'; exit 1
fi
echo "/////////// Deploy Habushu to Maven Central ///////////"
mvn clean deploy -P ossrh-release -Dmaven.build.cache.enabled=false
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Unable to deploy Habushu to Maven Central!'; exit 1
fi
echo "/////////// Update POM versions to the next development version ///////////"
mvn versions:set -DnewVersion=$2 -DgenerateBackupPoms=false
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Unable to update POM versions to the next development version!'; exit 1
fi
echo "/////////// Rebuild Habushu modules ///////////"
mvn clean install -Pbootstrap && mvn clean install -Dhabushu.usePyenv=false
if [[ "$?" -ne 0 ]] ; then
echo 'Rebuilding Habushu failed!'; exit 1
fi
echo "/////////// Commit all changes that reflect the next development iteration///////////"
mvn scm:checkin -Dmessage="Prepare for next development iteration"
if [[ "$?" -ne 0 ]] ; then
echo 'Process failed! Unable to commit changes for the next development iteration!'; exit 1
fi