Skip to main content
summaryrefslogtreecommitdiffstats
blob: 34cc6722050b1140e62ace9a4c48b4ab2d059ea4 (plain) (blame)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
#!/bin/bash +x

mavenVerbose=-X
mavenSign=-Peclipse-sign
mavenBREE=-Pbree-libs

#default values, overridden by command line
writableBuildRoot=/shared/eclipse/e4
relengProject=org.eclipse.e4.releng
relengBranch=master
buildType=I
date=$(date +%Y%m%d)
time=$(date +%H%M)
timestamp=$date$time
committerId=pwebster
gitEmail=pwebster@ca.ibm.com
gitName="E4 Build"

eclipseStream=4.5
e4Stream=0.17
basebuilderBranch=R3_7
eclipsebuilderBranch=R4_HEAD

quietCVS=-Q
arch="x86_64"
archProp="-x86_64"
processor=$( uname -p )
if [ $processor = ppc -o $processor = ppc64 ]; then
    archProp="-ppc"
    archJavaProp="-DarchProp=-ppc"
    arch="ppc"
fi

#
#  control various aspects of the build
#

publish=true
tag=true



while [ $# -gt 0 ]
do
        case "$1" in
                "-branch")
                        relengBranch="$2"; shift;;
                "-eclipseStream")
                        eclipseStream="$2"; shift;;
                "-e4Stream")
                        e4Stream="$2"; shift;;
                "-buildType")
                        buildType="$2"; shift;;
                "-gitCache")
                        gitCache="$2"; shift;;
                "-relengProject")
                        relengProject="$2"; shift;;
                "-root")
                        writableBuildRoot="$2"; shift;;
                "-committerId")
                        committerId="$2"; shift;;
                "-gitEmail")
                        gitEmail="$2"; shift;;
                "-gitName")
                        gitName="$2"; shift;;
                "-basebuilderBranch")
                        basebuilderBranch="$2"; shift;;
                "-eclipsebuilderBranch")
                        eclipsebuilderBranch="$2"; shift;;
                "-timestamp")
                        timestamp="$2";
                        date=${timestamp:0:8}
                        time=${timestamp:8};
                        shift;;
                 *) break;;      # terminate while loop
        esac
        shift
done

supportDir=$writableBuildRoot/build/e4
if [ -z "$gitCache" ]; then
	gitCache=$supportDir/gitClones
fi

if [ "$buildType" = N ]; then
	tag=false
fi

#publish
publishIndex="${committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/downloads"
publishUpdates="${committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/updates"
publishDir="${publishIndex}/drops"






# common properties

javaHome=/opt/public/common/jdk1.7.0-latest
buildTimestamp=${date}-${time}
buildTag=$buildType$buildTimestamp

oldBuildTag=$( cat $writableBuildRoot/${buildType}build.properties )
echo "Last build: $oldBuildTag"
echo $buildTag >$writableBuildRoot/${buildType}build.properties

buildDir=$writableBuildRoot/build/e4/downloads/drops/4.0.0
targetDir=${buildDir}/targets
targetZips=$targetDir/downloads
transformedRepo=${targetDir}/helios-p2
buildDirectory=$buildDir/$buildTag
updateSite=${targetDir}/updates/${e4Stream}-I-builds
    
e4TestDir=/opt/buildhomes/e4Build/e4Tests/$buildTag
sdkTestDir=/opt/buildhomes/e4Build/sdkTests/$buildTag
    
buildResults=$buildDirectory/$buildTag
    
sdkResults=$buildDir/40builds/$buildTag/$buildTag
sdkBuildDirectory=$buildDir/40builds/$buildTag

buildDirEclipse="$buildDir/eclipse"
WORKSPACE="$buildDir/workspace"
export WORKSPACE

TMP_DIR=$buildDirectory/tmp
export MAVEN_PATH=/opt/public/common/apache-maven-3.0.4/bin
export MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=256M -Djava.io.tmpdir=${TMP_DIR}"
export JAVA_HOME=$javaHome
export PATH=$JAVA_HOME/bin:${MAVEN_PATH}:$PATH


mkdir -p $TMP_DIR

cd $buildDirectory

gunzip -dc /home/data/httpd/download.eclipse.org/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz  | \
tar xf -

ECLIPSE=$(pwd)/eclipse/eclipse

localMavenRepo=$buildDirectory/localRepo

e4_releng=file:///gitroot/e4/org.eclipse.e4.releng.git
e4_tools=file:///gitroot/e4/org.eclipse.e4.tools.git
e4_search=file:///gitroot/e4/org.eclipse.e4.search.git
e4_lang=file:///gitroot/e4/org.eclipse.e4.languages.git
e4_resources=file:///gitroot/e4/org.eclipse.e4.resources.git
e4_databinding=file:///gitroot/e4/org.eclipse.e4.databinding.git
e4_ui=file:///gitroot/e4/org.eclipse.e4.ui.git

#git clone file:///gitroot/cbi/org.eclipse.cbi.maven.plugins.git
git clone $e4_releng
git clone $e4_tools
git clone $e4_search
git clone $e4_lang
git clone $e4_resources
git clone $e4_databinding
git clone $e4_ui

# tag first


pushd org.eclipse.e4.releng
git tag $buildTag
git push origin $buildTag
popd

pushd org.eclipse.e4.tools
git tag $buildTag
git push origin $buildTag
popd

pushd org.eclipse.e4.search
git tag $buildTag
git push origin $buildTag
popd

pushd org.eclipse.e4.languages
git tag $buildTag
git push origin $buildTag
popd

pushd org.eclipse.e4.resources
git tag $buildTag
git push origin $buildTag
popd

pushd org.eclipse.e4.databinding
git tag $buildTag
git push origin $buildTag
popd

pushd org.eclipse.e4.ui
git tag $buildTag
git push origin $buildTag
popd

/bin/bash \
org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/git-submission.sh \
$(pwd) \
$( echo $e4_tools | sed 's!file:///!git://git.eclipse.org/!g' ) \
$oldBuildTag $buildTag \
$( echo $e4_search | sed 's!file:///!git://git.eclipse.org/!g' ) \
$oldBuildTag $buildTag \
$( echo $e4_lang | sed 's!file:///!git://git.eclipse.org/!g' ) \
$oldBuildTag $buildTag \
$( echo $e4_resources | sed 's!file:///!git://git.eclipse.org/!g' ) \
$oldBuildTag $buildTag \
$( echo $e4_databinding | sed 's!file:///!git://git.eclipse.org/!g' ) \
$oldBuildTag $buildTag \
$( echo $e4_ui | sed 's!file:///!git://git.eclipse.org/!g' ) \
$oldBuildTag $buildTag >submission_report.txt 2>&1

mailx -s "$e4Stream Build: $buildTag submission" e4-dev@eclipse.org <submission_report.txt


# build everything


# In theory, this comes from repo.eclipse.org
#pushd org.eclipse.cbi.maven.plugins
#mvn -X \
#clean install \
#-Dmaven.repo.local=$localMavenRepo
#popd


pushd org.eclipse.e4.releng/cbi
mvn -f eclipse-parent/pom.xml \
clean install \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.tools
mvn $mavenVerbose \
clean install \
$mavenSign \
$mavenBREE \
-Dmaven.test.skip=true \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.search
mvn $mavenVerbose \
clean install \
$mavenSign \
$mavenBREE \
-Dmaven.test.skip=true \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.languages
mvn $mavenVerbose \
clean install \
$mavenSign \
$mavenBREE \
-Dmaven.test.skip=true \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.resources
mvn $mavenVerbose \
clean install \
$mavenSign \
$mavenBREE \
-Dmaven.test.skip=true \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.databinding
mvn $mavenVerbose \
clean install \
$mavenSign \
$mavenBREE \
-Dmaven.test.skip=true \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.ui
mvn $mavenVerbose \
clean install \
$mavenSign \
$mavenBREE \
-Dmaven.test.skip=true \
-Dmaven.repo.local=$localMavenRepo
popd

pushd org.eclipse.e4.releng/cbi
mvn -f org.eclipse.e4.releng.update/pom.xml \
clean verify \
-DbuildDirectory=$buildDirectory \
-Dmaven.repo.local=$localMavenRepo
popd

if [ ! -e repository ]; then
	mailx -s "$e4Stream Build: $buildTag Failed" e4-dev@eclipse.org <<EOF
Build log: http://build.eclipse.org/eclipse/e4/cbi/log.txt

EOF
exit 0
fi

# update the common repo

$ECLIPSE \
-noSplash \
-application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \
-source file://$(pwd)/repository \
-destination file://$updateSite \
-destinationName $e4Stream-I-builds


$ECLIPSE \
-noSplash \
-application org.eclipse.equinox.p2.metadata.repository.mirrorApplication \
-source file://$(pwd)/repository \
-destination file://$updateSite \
-destinationName $e4Stream-I-builds

# get ready to publish

mkdir -p $buildResults
cp -r repository $buildResults
cp submission_report.txt $buildResults

pushd repository
zip -r $buildResults/eclipse-e4-repo-incubation-${buildTag}.zip *
popd


cp org.eclipse.e4.releng/org.eclipse.e4.builder/templates/build.index.html t1
sed "s/@repbuildid@/$buildTag/g" t1 >t2
sed "s/@repmaindate@/$timestamp/g" t2 >t1
sed "s/@repbuilddate@/$buildTag/g" t1 >t2
repoSize=$( ls -l $buildResults/eclipse-e4-repo-incubation-${buildTag}.zip | awk ' {print $5 }' )
sed "s/@repobuildsize@/${repoSize}/g" t2 >$buildResults/index.html
rm -f t1 t2

cp /shared/eclipse/e4/cbi/log.txt $buildResults/buildlog.txt


echo Publishing  $buildResults to "$publishDir"
scp -r $buildResults "$publishDir"
rsync --recursive --delete ${updateSite} \
"${publishUpdates}"
#sendMail
sleep 60
wget -O index.txt http://download.eclipse.org/e4/downloads/createIndex.php
scp index.txt "$publishIndex"/index.html



Back to the top