-
Notifications
You must be signed in to change notification settings - Fork 104
/
create-release-branch.sh
executable file
·165 lines (122 loc) · 5.6 KB
/
create-release-branch.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/bash
export PERFECUT_ARTIFACT=ide
MVN_SETTINGS="--settings ${HOME}/.m2/fuseide-settings.xml"
. `dirname $0 2> /dev/null`/common.sh
ACTION=$1
cd "${basedir}"
git stash
git checkout master
git stash
git pull
BUILDNO=`cat ${PERFECUT_ARTIFACT}-buildno.txt`
BUILDNO=$((${BUILDNO}+1))
BUILD=`printf "%02d" "$((${BUILDNO}))"`
echo ============================================================================
echo " Incrementing build train to: ${PERFECUT_ARTIFACT}-${BUILD}"
echo "Using MVN_SETTINGS: ${MVN_SETTINGS}"
echo ============================================================================
echo ${BUILDNO} > ${PERFECUT_ARTIFACT}-buildno.txt
VERSION=7.2.${BUILDNO}
git commit -a -m "getting ready for version ${VERSION}"
git push origin master:master
git stash clear
echo "Creating release branch for ${VERSION}"
git branch release-${VERSION}
git checkout release-${VERSION}
# root project uses regular maven versions
find * -name 'pom.xml' | xargs perl -pi -e "s/<version>7.2.0-SNAPSHOT<\/version>/<version>${VERSION}<\/version>/g"
# replace the OSGi version names in poms
find plugins -name 'pom.xml' | xargs perl -pi -e "s/<version>7.2.0.qualifier<\/version>/<version>${VERSION}<\/version>/g"
# replace manifest versions
find plugins -name '*.xml' | xargs perl -pi -e "s/7.2.0.qualifier/${VERSION}/g"
find plugins -name 'bundle.properties' | xargs perl -pi -e "s/7.2.0.qualifier/${VERSION}/g"
find plugins -name 'MANIFEST.MF' | xargs perl -pi -e "s/7.2.0.qualifier/${VERSION}/g"
find plugins -name 'fuse*.product' | xargs perl -pi -e "s/7.2.0.qualifier/${VERSION}/g"
# replace IDE version
perl -pi -e "s/<ide-version>.*<\/ide-version>/<ide-version>${VERSION}<\/ide-version>/g" plugins/pom.xml
perl -pi -e "s/<ide-buildno>.*<\/ide-buildno>/<ide-buildno>${BUILDNO}<\/ide-buildno>/g" plugins/rcp_build/pom.xml
#echo "Zapping P2 cache of fusesource and snapshot stuff"
#rm -rf /mnt/hudson/.m2/repository/p2/osgi/bundle/org.fusesource*
#rm -rf /mnt/hudson/.m2/repository/p2/osgi/bundle/com.fusesource*
rm -rf /mnt/hudson/.m2/repository/p2/osgi/bundle/*/*SNAPSHOT
#rm -rf /mnt/hudson/.m2/repository/org/fusesource/
#rm -rf /mnt/hudson/.m2/repository/com/fusesource/
echo "Building the update site..."
cd plugins
#mvn ${MVN_SETTINGS} -Psign -Dkeystore=$PWD/fusesource.ks -Dstorepass=sp33d0 -Dalias=fusesource.com clean install
#mvn ${MVN_SETTINGS} clean install
# lets not fail the build if tests fail
mvn ${MVN_SETTINGS} -Dtest=false -DfailIfNoTests=false -Dmaven.test.skip=true clean install
if [ $? -eq 0 ] # Test exit status of "mvn" command.
then
echo "Build succeeded. Progress to update site deployment..."
else
echo "Build failed. Exit now..."
# exit $?
fi
# now copy the aggregated dependencies list to the rcp rootFiles folders
echo "From: 'Eclipse Foundation' (http://www.eclipse.org/)" >> ./target/maven-shared-archive-resources/META-INF/DEPENDENCIES
echo " - Eclipse Platform Bundles, 3.7 (Indigo) " >> ./target/maven-shared-archive-resources/META-INF/DEPENDENCIES
echo " License: Eclipse Public License, Version 1.0 (http://www.eclipse.org/legal/epl-v10.html)" >> ./target/maven-shared-archive-resources/META-INF/DEPENDENCIES
cp ./target/maven-shared-archive-resources/META-INF/DEPENDENCIES ./rcp_build/org.fusesource.ide.rcp.feature/rootFiles/unix/notices.txt
cp ./target/maven-shared-archive-resources/META-INF/DEPENDENCIES ./rcp_build/org.fusesource.ide.rcp.feature/rootFiles/win/notices.txt
# now deploy the update site
cd org.fusesource.ide.updatesite
mvn ${MVN_SETTINGS} updatesite:deploy
if [ $? -eq 0 ] # Test exit status of "mvn" command.
then
echo "Deployment succeeded. Progress to RCP build..."
else
echo "Deployment failed. Exit now..."
exit $?
fi
echo ============================================================================
echo "Update site complete now updating the update site versions"
echo ============================================================================
cd ../..
# echo "Build deployed - press OK to continue to update the site with the updated version"
# read dummy
# update the update site versions
./addUpdateSiteVersion ${VERSION} beta/updatesite
echo ============================================================================
echo "Creating the RCP build"
echo ============================================================================
cd plugins/rcp_build
#mvn ${MVN_SETTINGS} -Psign -Dkeystore=$PWD/fusesource.ks -Dstorepass=sp33d0 -Dalias=fusesource.com clean install
mvn ${MVN_SETTINGS} clean install
if [ $? -eq 0 ] # Test exit status of "mvn" command.
then
echo "Build succeeded. Progress to source archive creation..."
else
echo "Build failed. Exit now..."
exit $?
fi
echo "Generating the sources archive"
echo ============================================================================
cd ../..
./create-source-archive.sh
if [ $? -eq 0 ] # Test exit status of "mvn" command.
then
echo "Build succeeded. Progress to product archive deployment..."
else
echo "Build failed. Exit now..."
exit $?
fi
echo "Deploying the distribution archives"
echo ============================================================================
cd plugins/rcp_build/org.fusesource.ide.rcp.product
mvn ${MVN_SETTINGS} updatesite:deploy
if [ $? -eq 0 ] # Test exit status of "mvn" command.
then
echo "RCP deployment succeeded. Clean up and exit..."
else
echo "RCP deployment failed. Exit now..."
exit $?
fi
cd ../../..
echo "Deployed update site for Release ${VERSION}"
echo "Now committing branch"
git commit -a -m "Release ${VERSION}"
git push origin release-${VERSION}
git checkout master
echo "One it has been tested, move it to the production repo area"