forked from loren/dcos-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·34 lines (25 loc) · 873 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
28
29
30
31
32
33
34
#!/bin/bash
# This script does a full build/test of SDK artifacts. This does not upload the artifacts, instead
# see test.sh. This script (and test.sh) are executed by CI upon pull requests to the repository, or
# may be run locally by developers.
# Prevent jenkins from immediately killing the script when a step fails, allowing us to notify github:
set +e
REPO_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $REPO_ROOT_DIR
# GitHub notifier config
_notify_github() {
$REPO_ROOT_DIR/tools/github_update.py $1 build:sdk $2
}
# Build steps for SDK libraries:
_notify_github pending "SDK build running"
./gradlew clean jar
if [ $? -ne 0 ]; then
_notify_github failure "SDK build failed"
exit 1
fi
./gradlew check
if [ $? -ne 0 ]; then
_notify_github failure "SDK unit tests failed"
exit 1
fi
_notify_github success "SDK build succeeded"