-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.sh
53 lines (39 loc) · 1.78 KB
/
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
44
45
46
47
48
49
50
51
52
53
#connect the SAP HANA Integration System
#hdbuserstore set <mykey> <host:port> <user> <password>
hdbuserstore set HXECIKEY "${HANA_HOST}:${HANA_PORT}" "${HANA_USER}" "${HANA_PASSWORD}"
#create workspace local on the Jenkins server
regi create workspace regi_workspace --key=HXECIKEY -f
cd regi_workspace
mkdir -p ${PACKAGE}
# track the package of interest
regi track ${PACKAGE}
# check out a local copy from the SAP HANA repository
regi checkout --force
# Copy top level package directory of sources to regi workspace
rsync -qvrW --delete --exclude="regi_workspace" --exclude=".git" --exclude="._SYS_REGI_settings" "${WORKSPACE}/${top_level_package}" "${WORKSPACE}/regi_workspace/${PACKAGE}"
# Commit the changes
regi commit
# Activate the changes
regi activate
# Unassign the DU to get a proper state
regi unassign ${PACKAGE}
# Run tests --cacert /etc/ssl/certs/hxehostqa.mooo.com.crt
curl -u ${HANA_USER}:${HANA_PASSWORD} "https://${XS_HOST}:${XS_PORT}/sap/hana/testtools/unit/jasminexs/TestRunner.xsjs?package=com.sap.sapmentors.sitreg.test&format=json" -o test.json
# Output the test suites that where run
jq .suites test.json
# Check test result
FAILURES="$(jq ".failures" test.json)"
if [ ${FAILURES} -ne 0 ]
then exit ${FAILURES}
fi
# create the DU if not yet existing
regi show du ${DELIVERY_UNIT} || regi create du ${DELIVERY_UNIT} --vendor=sapmentors.sap.com --key=HXECIKEY
# Add BUILD_ID as Version Patch Number
regi update du ${DELIVERY_UNIT} --versionPatch=${BUILD_ID} --key=HXECIKEY
# assign the package to the DU
regi assign ${PACKAGE} ${DELIVERY_UNIT} --key=HXECIKEY
# Full DU export
mkdir ${WORKSPACE}/target
regi export ${DELIVERY_UNIT} "${WORKSPACE}/target/${DELIVERY_UNIT}.tgz" --key=HXECIKEY
# Make pom.xml available for sequel jobs
cp "${WORKSPACE}/pom.xml" "${WORKSPACE}/target"