Skip to content

Commit

Permalink
chore(build) single-thread ci builds (#2494)
Browse files Browse the repository at this point in the history
hoping for less/no cases of builds timing out with no output which may be
to too many things happening in parallel that none is making progress
fast enough
  • Loading branch information
cfieber authored and Justin Reynolds committed Apr 6, 2018
1 parent 828c9c7 commit 03912e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
#!/bin/bash
# This script will build the project.

GRADLE="./gradlew --no-daemon --max-workers=1"
export GRADLE_OPTS="-Xmx1g -Xms1g"

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -Prelease.useLastTag=true -Pskip.loadtest=true build
$GRADLE -Prelease.useLastTag=true -Pskip.loadtest=true build
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pskip.loadtest=true -x test build snapshot --stacktrace
$GRADLE -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pskip.loadtest=true -x test build snapshot --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
case "$TRAVIS_TAG" in
version-*)
;; # Ignore Spinnaker product release tags.
*-rc\.*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pskip.loadtest=true -x test candidate --stacktrace
$GRADLE -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pskip.loadtest=true -x test candidate --stacktrace
;;
*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pskip.loadtest=true -x test final --stacktrace
$GRADLE -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pskip.loadtest=true -x test final --stacktrace
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew -Prelease.useLastTag=true -Pskip.loadtest=true build
$GRADLE -Prelease.useLastTag=true -Pskip.loadtest=true build
fi

9 changes: 5 additions & 4 deletions gradle/installViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/bash
# This script will build the project.

GRADLE="./gradlew --no-daemon --max-workers=1"
export GRADLE_OPTS="-Xmx1g -Xms1g"

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Assemble Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -Pskip.loadtest=true assemble
$GRADLE -Pskip.loadtest=true assemble
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true -Pskip.loadtest=true -x test assemble
$GRADLE -Prelease.travisci=true -Pskip.loadtest=true -x test assemble
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Assemble Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -Pskip.loadtest=true -x test assemble
$GRADLE -Prelease.travisci=true -Prelease.useLastTag=true -Pskip.loadtest=true -x test assemble
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew -Pskip.loadtest=true assemble
$GRADLE -Pskip.loadtest=true assemble
fi

0 comments on commit 03912e2

Please sign in to comment.