blob: 89762ff93a24da894aaccd05ff6330fc10f0b4fa [file] [log] [blame]
Benjamin Cabe4ea19942009-07-07 20:15:29 +00001#!/bin/bash
2
3# This script runs as https://build.eclipse.org/hudson/job/cbi-*/configure
4# and is archived in http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.commonbuilder.releng/hudson/?root=Technology_Project
5# Build runs under ${WORKSPACE} == /opt/users/hudsonbuild/.hudson/jobs/cbi-*/workspace
6
7echo "[`date +%Y/%m/%d\ %H:%M`] Hudson job ${JOBNAME} build #${BUILD_NUMBER} (${BUILD_ID}) started."
8
9##############################################################################################
10
11# BEGIN CONFIGURATION
12
13buildTimestamp="`date +%Y%m%d%H%M`"
Benjamin Cabe7e1c6d52009-07-08 18:43:24 +000014projectid="org.eclipse.pde.ds"
Benjamin Cabe4ea19942009-07-07 20:15:29 +000015version="0.1.0"
16
17# leave blank to use assumed values (which may be wrong!)
Benjamin Cabe7e1c6d52009-07-08 18:43:24 +000018projNamespace='-projNamespace org.eclipse.pde.ds'
Benjamin Cabe4ea19942009-07-07 20:15:29 +000019projRelengRoot='-projRelengRoot :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse'
Benjamin Cabe7e1c6d52009-07-08 18:43:24 +000020projRelengPath='-projRelengPath pde-incubator/modeling/releng/org.eclipse.pde.ds.releng'
Benjamin Cabed1d4b632009-07-08 18:31:56 +000021projRelengName='-projRelengName org.eclipse.pde.ds.releng'
Benjamin Cabeaf1df9a2009-07-08 18:46:28 +000022sub='-sub pde.ds'
Benjamin Cabe4ea19942009-07-07 20:15:29 +000023
24# DONE CONFIGURATION
25
26##############################################################################################
27
28# exposed as a Hudson build parameter for convenience
29if [[ $BUILDTYPE ]]; then
30 buildType="$BUILDTYPE"
31else
32 buildType="N"
33fi
34
35# pass in additional flags like -buildAlias=1.0.0RC2 using the $EXTRAFLAGS Hudson parameter
36# buildAlias will rename zips from foo-SDK-N200901011234.zip to foo-SDK-1.0.0RC2.zip
37
38##############################################################################################
39
40# define where to do all the work; start with a fresh folder each time
41writableBuildRoot="${WORKSPACE}/build"
42if [[ -d ${writableBuildRoot} ]]; then rm -fr ${writableBuildRoot}; fi
43
44# define required folders
45downloadsDir="${writableBuildRoot}/downloads"
46signingDir="${writableBuildRoot}/signing"
47
48# long form (default if omitted)
49# buildDir="${writableBuildRoot}/${projectid//.//}/downloads/drops/${version}/${buildType}${buildTimestamp}"
50# short form (non-default)
51buildDir="${writableBuildRoot}/${buildType}${buildTimestamp}"
52
53# create required folders & files (as symlinks is possible)
54mkdir -p ${downloadsDir} ${signingDir} ${buildDir}
55
56# create .cvspass file to shut up unnecessary warnings
57touch ${writableBuildRoot}/.cvspass
58
59#define symlinked required folders
60relengBaseBuilderDir="${writableBuildRoot}/org.eclipse.releng.basebuilder"
61relengCommonBuilderDir="${writableBuildRoot}/org.eclipse.dash.common.releng"
Benjamin Cabe24ae4de2009-07-07 20:17:55 +000062# symlink basebuilder and common.releng; alternatively, if you omit this, they will be checked out in start.sh
Benjamin Cabe4ea19942009-07-07 20:15:29 +000063ln -s /opt/public/cbi/build/org.eclipse.releng.basebuilder ${writableBuildRoot}/
64ln -s /opt/public/cbi/build/org.eclipse.dash.common.releng ${writableBuildRoot}/
65
66# symlink 3rdPartyJars (reuse existing content on build.eclipse.org for ant-contrib.jar, etc.)
67thirdPartyJarsDir="${writableBuildRoot}/3rdPartyJars"
68ln -s /opt/public/cbi/build/3rdPartyJars ${writableBuildRoot}/
69
70# run a build
71cd ${writableBuildRoot}/org.eclipse.dash.common.releng/tools/scripts
72./start.sh -projectid ${projectid} -version ${version} -buildType ${buildType} -buildTimestamp ${buildTimestamp} \
73 -writableBuildRoot ${writableBuildRoot} -thirdPartyJarsDir ${thirdPartyJarsDir} -downloadsDir ${downloadsDir} -buildDir ${buildDir} \
Benjamin Cabeaf1df9a2009-07-08 18:46:28 +000074 ${projRelengRoot} ${projRelengPath} ${projRelengName} ${sub} ${EXTRAFLAGS} 2>&1
Benjamin Cabe4ea19942009-07-07 20:15:29 +000075
76# remove file so workspace navigation is one click simpler
77rm -f ${writableBuildRoot}/.cvspass
78
79echo "[`date +%Y/%m/%d\ %H:%M`] Hudson job ${JOBNAME} build #${BUILD_NUMBER} (${BUILD_ID}) done."