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

Commit

Permalink
Add endtoend crossdock (#154)
Browse files Browse the repository at this point in the history
* Add endtoend crossdock test
* Only upload to docker hub on master
  • Loading branch information
black-adder authored and yurishkuro committed Apr 27, 2017
1 parent 846fde2 commit 9c74133
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 48 deletions.
40 changes: 17 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ sudo: required

language: java

dist: trusty

matrix:
include:
- env:
- TESTS=true
- COVERAGE=true
- env:
- CROSSDOCK=true

services:
- docker

Expand All @@ -28,32 +38,16 @@ cache:
- $HOME/.gradle/wrapper/

before_install:
- docker version
- sudo rm -rf /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname
-s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose version
- if [ "$CROSSDOCK" == true ]; then bash ./travis/install-crossdock-deps.sh ; fi
- sudo rm -rf /usr/local/bin/thrift
- sudo cp travis/docker-thrift/thrift /usr/local/bin/


script:
- make test
- make crossdock-fresh
- ./gradlew codeCoverageReport
- if [ "$TESTS" == true ]; then make test ; 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:
- bash <(curl -s https://codecov.io/bash)
- ./gradlew uploadArchives -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}"
- pushd 'jaeger-crossdock'
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- 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`
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, PR=$PR, BRANCH=$BRANCH, TAG=$TAG"
- docker build -f Dockerfile -t $REPO:$COMMIT .
- docker tag $REPO:$COMMIT $REPO:$TAG
- docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO
- popd
- if [ "$COVERAGE" == true ]; then bash <(curl -s https://codecov.io/bash) ; fi
- if [ "$CROSSDOCK" == true ]; then ./gradlew uploadArchives -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" ; fi
49 changes: 24 additions & 25 deletions jaeger-crossdock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ services:
crossdock:
image: crossdock/crossdock
links:
- test_driver
- go
- java
- python
environment:
- WAIT_FOR=go,java,python
- WAIT_FOR=test_driver,go,java,python
- WAIT_FOR_TIMEOUT=60s

- CALL_TIMEOUT=60s

- AXIS_CLIENT=go
- AXIS_S1NAME=go,java,python
- AXIS_SAMPLED=true,false
Expand All @@ -21,39 +24,35 @@ services:

- BEHAVIOR_TRACE=client,s1name,sampled,s2name,s2transport,s3name,s3transport

- AXIS_TESTDRIVER=test_driver
- AXIS_SERVICES=go

- BEHAVIOR_ENDTOEND=testdriver,services

- REPORT=compact
go:
image: jaegertracing/xdock-go
ports:
- "8080-8082"

python:
image: jaegertracing/xdock-py
ports:
- "8080-8082"
image: jaegertracing/xdock-py
ports:
- "8080-8082"

java:
build: .
ports:
- "8080-8082"
# node:
# image: yarpc/yarpc-node
# ports:
# - "8080-8082"
#
# java:
# image: yarpc/yarpc-java
# ports:
# - "8080-8082"
#
# python:
# image: yarpc/yarpc-python
# ports:
# - "8080:8082"
#
# python-sync:
# image: yarpc/yarpc-python
# ports:
# - 8080
# environment:
# - SYNC=1

cassandra:
image: "cassandra:3.9"

test_driver:
image: jaegertracing/test-driver
links:
- cassandra
depends_on:
- cassandra
ports:
- "8080"
24 changes: 24 additions & 0 deletions travis/build-crossdock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

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`
echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, PR=$PR, BRANCH=$BRANCH, TAG=$TAG"

# Only push the docker container to Docker Hub for master branch
if [ "$BRANCH" == "master" ]; then echo 'upload to Docker Hub'; else echo 'skip docker upload for PR'; exit 0; fi

docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD

set -x

pushd 'jaeger-crossdock'
docker build -f Dockerfile -t $REPO:$COMMIT .
popd
docker tag $REPO:$COMMIT $REPO:$TAG
docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
docker push $REPO
12 changes: 12 additions & 0 deletions travis/install-crossdock-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

docker version

# Install docker-compose
sudo rm -f /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
docker-compose version

0 comments on commit 9c74133

Please sign in to comment.