-
Notifications
You must be signed in to change notification settings - Fork 5
/
release.sh
executable file
·104 lines (95 loc) · 3.68 KB
/
release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#/bin/sh
#
# Checks if there is an error flag active and if so,
# shows an error message and terminates the script
#
# $1 : error message to show
#
check_error() {
if [ $? -ne 0 ]
then
echo
echo "ERROR: $1"
echo
exit 1
fi
}
#
# Generate the release file
#
# $1 : Release version
# $2 : Development version
# $3 : Release Tag
#
create_release_file() {
REL_VERSION=$1
DEV_VERSION=$2
TAG_VERSION=$3
cat > release.properties <<EOF
#release configuration
#Fri Jun 20 12:51:50 BRT 2008
scm.tag=$TAG_VERSION
project.rel.org.drools\:drools-ant=$REL_VERSION
project.dev.org.drools\:drools-templates=$DEV_VERSION
project.dev.org.drools\:drools-clips=$DEV_VERSION
project.dev.org.drools.solver\:drools-solver=$DEV_VERSION
project.dev.org.drools\:drools-repository=$DEV_VERSION
project.rel.org.drools\:drools-repository=$REL_VERSION
project.rel.org.drools.solver\:drools-solver-core=$REL_VERSION
project.rel.org.drools\:drools-clips=$REL_VERSION
project.rel.org.drools.solver\:drools-solver=$REL_VERSION
project.dev.org.drools\:drools-decisiontables=$DEV_VERSION
project.dev.org.drools.solver\:drools-solver-examples=$DEV_VERSION
project.dev.org.drools\:drools-compiler=$DEV_VERSION
project.rel.org.drools\:drools-core=$REL_VERSION
project.dev.org.drools\:drools-verifier=$DEV_VERSION
project.dev.org.drools\:drools-guvnor=$DEV_VERSION
project.rel.org.drools\:drools-compiler=$REL_VERSION
project.dev.org.drools\:drools-ant=$DEV_VERSION
project.rel.org.drools\:drools-verifier=$REL_VERSION
project.rel.org.drools\:drools-decisiontables=$REL_VERSION
project.rel.org.drools\:drools-templates=$REL_VERSION
project.dev.org.drools\:drools-jsr94=$DEV_VERSION
project.rel.org.drools\:drools-guvnor=$REL_VERSION
project.dev.org.drools.solver\:drools-solver-core=$DEV_VERSION
project.rel.org.drools\:drools=$REL_VERSION
project.rel.org.drools\:drools-jsr94=$REL_VERSION
project.dev.org.drools\:drools=$DEV_VERSION
project.dev.org.drools\:drools-core=$DEV_VERSION
project.rel.org.drools.solver\:drools-solver-examples=$REL_VERSION
EOF
}
#
# Main script
#
echo "*************************************************************"
echo "------> Importing release configuration"
. release.env
echo "CURRENT_VERSION = $CURRENT_VERSION"
echo "RELEASE_VERSION = $RELEASE_VERSION"
echo "NEW_VERSION = $NEW_VERSION"
echo "TAG_NAME = $TAG_NAME"
echo
echo "*************************************************************"
echo "------> Updating release version in configuration files"
$ANT -f update-version.xml -Dcurrent="$CURRENT_VERSION" -Dnew="$RELEASE_VERSION" updateVersion
check_error "****** Error updating version numbers. Exiting. ******"
echo
echo "*************************************************************"
echo "------> Commiting new version into trunk"
$SVN commit -m "$JIRA_TICKET : preparing release. Updating files from version $CURRENT_VERSION to $RELEASE_VERSION"
check_error "****** Error commiting update files to trunk. Exiting. ******"
echo
echo "*************************************************************"
echo "------> Preparing the release"
$MVN release:clean
check_error "****** Error cleaning up for the release. Exiting. ******"
create_release_file $RELEASE_VERSION $NEW_VERSION $TAG_NAME
$MVN --batch-mode release:prepare
check_error "****** Error preparing the release. Exiting. ******"
echo
echo "*************************************************************"
echo "------> Generating artifacts"
$MVN -Ddocumentation -Declipse -Dmaven.test.skip -Dydoc.home=$YDOC_HOME -DlocalEclipseDrop=/home/hudson/configs/jboss-rules/local-eclipse-drop-mirror package javadoc:javadoc assembly:assembly
check_error "****** Error generating distribution artifacts. Exiting. ******"
echo