-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sh
27 lines (23 loc) · 989 Bytes
/
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
# install the MTA archive builder
WORKSPACE=`pwd`
# install neo command line client
mkdir -p ${WORKSPACE}/tmp/neo-java-web-sdk
cd ${WORKSPACE}/tmp/neo-java-web-sdk
wget -nv 'https://repo1.maven.org/maven2/com/sap/cloud/neo-java-web-sdk/3.109.16/neo-java-web-sdk-3.109.16.zip'
unzip -qq -o neo-java-web-sdk-3.109.16.zip
rm neo-java-web-sdk-3.109.16.zip
# extract artifact name
cd ${WORKSPACE}
wget -nv --output-document=jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x ./jq
mtaName=`js-yaml mta.yaml | jq -r '.ID'`
# replace timestamp placeholder
sed -ie "s/\${timestamp}/`date +%Y%m%d%H%M%S`/g" mta.yaml
# execute MTA build
mkdir -p ${WORKSPACE}/dist
npm install
npm run build
cp ${WORKSPACE}/neo-app.json ${WORKSPACE}/dist
java -jar ${WORKSPACE}/tmp/mta/mta.jar --mtar ${CIRCLE_PROJECT_REPONAME}.mtar --build-target=NEO build
mkdir -p ${WORKSPACE}/dist/mta
cp ${CIRCLE_PROJECT_REPONAME}.mtar dist/mta/${CIRCLE_PROJECT_REPONAME}-`date +%Y%m%d%H%M%S`.mtar