Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a3eeaefd4e93b84e2f02d39e290ed92a173cbfcf (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
#!/bin/bash
#
# This script is used to trigger the runtime build with parameters passed by Hudson.
# All values are retrieved trough system variables set by Hudson.
# See Job -> Configure... -> This build is parameterized

SCRIPTS_DIR=$(dirname $(readlink -nm $0))
. $SCRIPTS_DIR/build-environment.sh

if [ "${BUILD_TYPE:0:1}" == "S" ]; then
  sign=true
else
  sign=false
fi

######################################################################
# Cleanup left-overs from previous run

test -d "$WORKSPACE" || exit 1
rm -rf "$WORKSPACE"/runtimeRepo "$WORKSPACE"/*.zip

######################################################################
# Build RAP Runtime

cd "$WORKSPACE/org.eclipse.rap/releng/org.eclipse.rap.releng"
echo "Running maven on $PWD, sign=$sign"
$MVN -e clean package -Dsign=$sign
exitcode=$?
if [ "$exitcode" != "0" ]; then
  echo "Maven exited with error code " + $exitcode
fi

if [ -d repository/target/fixedPacked ]; then
  mv repository/target/fixedPacked "$WORKSPACE/runtimeRepo" || exit 1
else
  mv repository/target/repository "$WORKSPACE/runtimeRepo" || exit 1
fi

VERSION=$(ls "$WORKSPACE"/runtimeRepo/features/org.eclipse.rap.runtime_*.jar | sed 's/.*_\([0-9.-]\+\)\..*\.jar/\1/')
TIMESTAMP=$(ls "$WORKSPACE"/runtimeRepo/features/org.eclipse.rap.runtime_*.jar | sed 's/.*\.\([0-9-]\+\)\.jar/\1/')
echo "Version is $VERSION"
echo "Timestamp is $TIMESTAMP"
test -n "$VERSION" || exit 1
test -n "$TIMESTAMP" || exit 1

######################################################################
# Build Aggregation Repository

cd "$WORKSPACE/org.eclipse.rap/releng/org.eclipse.rap.target.releng"
echo "Running maven on $PWD, sign=$sign"
$MVN -e clean package -DruntimeRepo="file://$WORKSPACE/runtimeRepo" -Dsign=$sign || exit 1

# Example: rap-runtime-1.5.0-N-20110814-2110.zip
zipFileName=rap-runtime-$VERSION-$BUILD_TYPE-$TIMESTAMP.zip
compatZipFileName=rap-runtime-compatibility-$VERSION-$BUILD_TYPE-$TIMESTAMP.zip

if [ -d repository/target/fixedSigned ]; then
  mv repository/target/fixedSigned/*.zip "$WORKSPACE/$zipFileName" || exit 1
else
  mv repository/target/*.zip "$WORKSPACE/$zipFileName" || exit 1
fi

if [ "$sign" == "true" -a -d compatibility-repository/target ]; then
  mv compatibility-repository/target/*.zip "$WORKSPACE/$compatZipFileName" || exit 1
fi

######################################################################
# Include legal files in zip

cd "$WORKSPACE"
cp -f org.eclipse.rap/releng/org.eclipse.rap.releng/legal/notice.html .
cp -f org.eclipse.rap/releng/org.eclipse.rap.releng/legal/epl-v10.html .
zip "$zipFileName" notice.html epl-v10.html

Back to the top