forked from grails/grails-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
executable file
·35 lines (28 loc) · 1.09 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
#!/bin/bash
set -x
# Set Gradle daemon JVM args
mkdir ~/.gradle
echo "org.gradle.jvmargs=-XX\:MaxPermSize\=512m -Xmx1024m -Dfile.encoding\=UTF-8 -Duser.country\=US -Duser.language\=en -Duser.variant" >> ~/.gradle/gradle.properties
echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties
grailsVersion="$(grep 'grailsVersion =' build.gradle | egrep -v ^[[:blank:]]*\/\/)"
grailsVersion="${grailsVersion#*=}"
grailsVersion="${grailsVersion//[[:blank:]\'\"]/}"
echo "Project Version: '$grailsVersion'"
echo "Gradle command to be run: '$GRADLE_CMD'"
EXIT_STATUS=0
./gradlew --stop
if [[ $TRAVIS_TAG =~ ^v[[:digit:]] ]]; then
echo "Tagged Release Skipping Tests for Publish"
else
echo "Executing tests"
./gradlew $GRADLE_FLAGS $GRADLE_CMD || EXIT_STATUS=$?
echo "Done."
fi
export EXIT_STATUS
export grailsVersion
# done. after build, then after_success will run if EXIT_STATUS is 0
#
# This also means that the later modifications to EXIT_STATUS will not affect
# the build status: Build could now be success, even though the later steps will
# change EXIT_STATUS variable
exit $EXIT_STATUS