Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Use travis stages to simplify config #389

Merged
merged 6 commits into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
sudo: required
language: java
dist: trusty
matrix:
include:
- env:
- TESTS=true
- COVERAGE=true
- env:
- CROSSDOCK=true
services:
- docker
env:
Expand Down Expand Up @@ -36,11 +29,26 @@ cache:
- "$HOME/.gradle/wrapper/"
before_install:
- ./travis/prepare-signing.sh $encrypted_677f232983c0_key $encrypted_677f232983c0_iv
- if [ "$CROSSDOCK" == true ]; then bash ./travis/install-crossdock-deps.sh ; fi
script:
- if [ "$TESTS" == true ]; then make test-travis ; else echo 'skipping tests'; fi
- if [ "$COVERAGE" == true ]; then ./gradlew codeCoverageReport ; else echo 'skipping coverage'; fi
- if [ "$CROSSDOCK" == true ]; then bash ./travis/build-crossdock.sh ; else echo 'skipping crossdock'; fi
after_success:
- if [ "$COVERAGE" == true ]; then bash <(curl -s https://codecov.io/bash) ; fi
- if [ "$CROSSDOCK" == true -a "$TRAVIS_PULL_REQUEST" == false ]; then ./gradlew upload ; fi

stages:
- name: test
- name: deploy
if: env(TRAVIS_PULL_REQUEST) = false

jobs:
include:
- stage: test
env: [ NAME=unit-test ]
script: make test-travis && ./gradlew codeCoverageReport && bash <(curl -s https://codecov.io/bash)

- stage: test
env: [ NAME=crossdock ]
script: make crossdock-fresh

- stage: deploy
env: [ NAME=deploy-to-maven ]
script: ./gradlew upload

- stage: deploy
env: [ NAME=deploy-to-dockerhub ]
script: ./travis/publish-crossdock.sh
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The release process consists of these steps:
1. Create and push tag with the new version `git tag v0.20.0 && git push origin v0.20.0`
1. Once the *tag* build finishes in Travis, the artifacts should have been uploaded to Sonatype staging,
the staging repository closed, and the artifacts on the way to Maven Central (it takes 20min+ to get there).
In case of failures it is safe to retry by restarting the CROSSDOCK step of the build. If it keeps
In case of failures it is safe to retry by restarting the maven-deploy job. If it keeps
failing, sometimes it may be necessary to close the staging repository manually.
1. Create a release on GitHub for the new tag. Use the changes from the `CHANGELOG` as the description.
1. Once the artifacts are available on Maven
Expand Down
2 changes: 0 additions & 2 deletions travis/build-crossdock.sh → travis/publish-crossdock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -e

make crossdock-fresh

export REPO=jaegertracing/xdock-java
export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
export TAG=`if [ "$BRANCH" == "master" ]; then echo "latest"; else echo "${BRANCH///}"; fi`
Expand Down