Skip to content

Commit

Permalink
Merge pull request #1901 from Netflix/publish_via_travis
Browse files Browse the repository at this point in the history
Enable publishing via travis
  • Loading branch information
elandau authored Nov 16, 2018
2 parents ed2c966 + 98dc4a7 commit 809104c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 5 deletions.
18 changes: 15 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,20 @@ sudo: false
jdk:
- oraclejdk8

script:
- ./gradlew --info check -x test
install: "./installViaTravis.sh"

script: "./buildViaTravis.sh"

cache:
directories:
- "$HOME/.gradle"

after_failure:
- if [ -f /home/travis/build/Netflix/Hystrix/hystrix-core/build/reports/tests/test/index.html ]; then lynx -dump /home/travis/build/Netflix/Hystrix/hystrix-core/build/reports/tests/test/index.html; fi
- if [ -f /home/travis/build/Netflix/Hystrix/hystrix-core/build/reports/tests/test/index.html ]; then lynx -dump /home/travis/build/Netflix/Hystrix/hystrix-core/build/reports/tests/test/index.html; fi
env:
global:
- secure: PKFOXNElIioKzR25ekT5PN9FITsQnORw8GjaYdVZecdO1nIZ89vt9UmI1UnD4Jm1qsLm2o+Bv77KCU6L0bQiFernyl9400OGEVHRiXl4UuNIkWOruVgRM5BBQixbvLzqP9ul9qxNDXhB8oP/wXGMVeBEKxutb1/0AXnLlLspF9U=
- secure: XvRKpxC/Qh4k2LIAdFgaIEP0UW9OCoIDXt4o8494drLD/VVOZX9Ig8trFqHtfZrwBiI3zpe0XKJEPNHHAap+MyQ4SpXv13VFDGPhQCdgfcnJ4mj1Nf34J1nFRj/nZsgC99gn28qExY9tB+9IJ4MmidUvGgzN4Q7y21XbvRmmk34=
- secure: FEeb9KksyAPPzEqRZCWpSr2rPh1kJV/ltNYpyIhM1W+jCf3IVESluGGbZD2ufzv6toGNUzXF82i/bWkNOP4FFnGcYltZ/2OiVQHdZliP4k2xW4Kvl1bMAXkAHstoNoOQqgupnt3SRc/WYe1zfc3FsHW0ADwRpBDFkFdhro1rSRo=
- secure: dkJ2w6CIxwo5qIh3sw59PvXvs+ht/hsuaP3IM47rMDo0FcqC86ZhjoWesizmktK7aU5K8A786xP4VZIbGWcrC++Igq3feLwhreCGVNAgLSoE5o7uRTmD3Rd9Z2TEZgKnxPyHoSv2G6H73Kgm64r+6JTpgamB84vgymhnDVbmIes=
- secure: PFeXGAjK07eBNbOTFq9AjNsQGlIN+H01TAcX1NraFdoEEIM+qvdf6hVK81d0dmceQvR7r0ZBGXOAI+x8/6otBqFB/8nb10Yhl2Qzw+ZlO/Au1kIrhLYrev1Z4xa9ZzgdIbGeLB2QHjbEnaXPekIE/qwTkEL4qssP7YGFG7uVhhE=
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ allprojects {
}

apply plugin: 'net.saliman.cobertura'

tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:none', true)
}
}

subprojects {
Expand All @@ -34,8 +38,6 @@ subprojects {
sourceCompatibility = 1.6
targetCompatibility = 1.6



group = "com.netflix.${githubProjectName}"

eclipse {
Expand Down
23 changes: 23 additions & 0 deletions buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# This script will build the project.

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew build -x test
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}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" -Prelease.scope=patch build snapshot -x test
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
case "$TRAVIS_TAG" in
*-rc\.*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate -x test
;;
*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final -x test
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew build -x test
fi
2 changes: 2 additions & 0 deletions hystrix-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ javadoc {
windowTitle = "Hystrix Javadoc ${project.version}"
}
options.addStringOption('top').value = '<a href="https://github.com/Netflix/Hystrix"><img width="92" height="79" border="0" align="left" src="http://netflix.github.com/Hystrix/images/hystrix-logo-small.png"></a><h2 class="title" style="padding-top:40px">Hystrix: Latency and Fault Tolerance for Distributed Systems</h2>'

enabled = false
}

jar {
Expand Down
16 changes: 16 additions & 0 deletions installViaTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# This script will build the project.

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Assemble Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew assemble -x test
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true assemble -x test
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 assemble -x test
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew assemble -x test
fi

0 comments on commit 809104c

Please sign in to comment.