Skip to content

Commit

Permalink
Build script update to fail on errors from maven or gradle. Switched …
Browse files Browse the repository at this point in the history
…to gradle wrapper to force gradle 5
  • Loading branch information
sapessi committed Dec 22, 2018
1 parent bf8f032 commit 9d4da29
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.gradle/
gradle/
build/
gradlew*

# Exclude maven wrapper
!/.mvn/wrapper/maven-wrapper.jar
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ language: java
dist: trusty
jdk:
- openjdk8
install: true
script: ./travis.sh
41 changes: 39 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ IFS=$'\n'
echo "STARTING TRAVIS BUILD in $(pwd)"
cd $TRAVIS_BUILD_DIR
mvn install
if [[ "$?" -ne 0 ]]; then
exit 1
fi
echo "COMPLETED MAIN FRAMEWORK INSTALL"

echo "STARTING SAMPLES BUILD"
Expand All @@ -13,7 +16,21 @@ do
echo "BUILDING SAMPLE '$SAMPLE'"
cd $SAMPLE
mvn clean package
gradle clean build
if [[ "$?" -ne 0 ]]; then
exit 1
fi
gradle wrapper
if [[ "$?" -ne 0 ]]; then
exit 1
fi
./gradlew wrapper --gradle-version 5.0
if [[ "$?" -ne 0 ]]; then
exit 1
fi
./gradlew clean build
if [[ "$?" -ne 0 ]]; then
exit 1
fi

SAM_FILE="$TRAVIS_BUILD_DIR/$SAMPLE/sam.yaml"
if [[ -f "$SAM_FILE" ]]; then
Expand Down Expand Up @@ -46,11 +63,31 @@ do
-DarchetypeArtifactId=$ARCH_NAME \
-DarchetypeCatalog=local \
-DinteractiveMode=false
if [[ "$?" -ne 0 ]]; then
exit 1
fi
cd ${TEST_PROJ}
mvn clean package -Pshaded-jar
if [[ "$?" -ne 0 ]]; then
exit 1
fi
mvn clean package
if [[ "$?" -ne 0 ]]; then
exit 1
fi
if [[ -f "$TRAVIS_BUILD_DIR/tmp/$TEST_PROJ/build.gradle" ]]; then
gradle clean build
gradle wrapper
if [[ "$?" -ne 0 ]]; then
exit 1
fi
./gradlew wrapper --gradle-version 5.0
if [[ "$?" -ne 0 ]]; then
exit 1
fi
./gradlew clean build
if [[ "$?" -ne 0 ]]; then
exit 1
fi
else
echo "GRADLE BUILD FILE NOT FOUND"
fi
Expand Down

0 comments on commit 9d4da29

Please sign in to comment.