forked from apache/grails-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-build.sh
executable file
·42 lines (31 loc) · 1.07 KB
/
travis-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
#!/bin/bash
grailsVersion="$(grep 'grailsVersion =' build.gradle | egrep -v ^[[:blank:]]*\/\/)"
grailsVersion="${grailsVersion#*=}"
grailsVersion="${grailsVersion//[[:blank:]\'\"]/}"
echo "Project Version: '$grailsVersion'"
EXIT_STATUS=0
./gradlew --stop
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
echo "Executing tests"
./gradlew --no-daemon --stacktrace test || EXIT_STATUS=$?
echo "Done."
echo "Executing integration tests"
./gradlew --no-daemon --stacktrace --info integrationTest < /dev/null || EXIT_STATUS=$?
echo "Done."
if [[ $TRAVIS_PULL_REQUEST == 'false' && $EXIT_STATUS -eq 0 ]]; then
echo "Publishing archives"
if [[ -n $TRAVIS_TAG ]]; then
./gradlew bintrayUpload || EXIT_STATUS=$?
./gradlew assemble || EXIT_STATUS=$?
version="$TRAVIS_TAG"
version=${version:1}
zipName="grails-$version"
export RELEASE_FILE="build/distributions/${zipName}.zip"
else
./gradlew publish || EXIT_STATUS=$?
fi
fi
if [[ $EXIT_STATUS == 0 ]]; then
./gradlew travisciTrigger -i
fi
exit $EXIT_STATUS