forked from rundeck/rundeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins-build.sh
43 lines (29 loc) · 1.02 KB
/
jenkins-build.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
#!/bin/bash
set -e
set -x
# script for use by jenkins to build rundeck
# arguments: ['release' [tag]]
# if the first argument is 'release', a release build will be made, with an optional release tag
REL="${1:-no}"
RTAG="${2:-GA}"
export BUILD_ROOT=$WORKSPACE/build_root
echo "RTAG: ${RTAG}"
make clean
if [ "$REL" = "release" ] ; then
# build with release tag
./gradlew -Penvironment=release -PreleaseTag=${RTAG} build
# test artifact contents
groovy testbuild.groovy -gradle -Drelease -DreleaseTag=${RTAG}
elif [ "$REL" = "upload" ] ; then
# upload archives to sonatype nexus
# need more memory otherwise OOM error uploading war file
GRADLE_OPTS="-Xmx1024m -Xms256m" ./gradlew ${PROXY_DEFS} --no-daemon -Penvironment=release -PreleaseTag=${RTAG} \
${RELEASE_OPTS} uploadArchives
# close nexus staging repos
./gradlew ${PROXY_DEFS} --no-daemon nexusStagingRelease
exit $?
else
./gradlew -Penvironment=build build
groovy testbuild.groovy -gradle
fi
make TAG=${RTAG} rpm deb