From 03da7512efcf273e8f73eef92834cdea1557717a Mon Sep 17 00:00:00 2001 From: Onwukike Ibe Date: Wed, 27 Jul 2016 11:14:58 -0700 Subject: [PATCH] fix travis --- .travis.yml | 15 ++++++++++++--- travis/publish_docker_image.sh | 18 ------------------ 2 files changed, 12 insertions(+), 21 deletions(-) delete mode 100644 travis/publish_docker_image.sh diff --git a/.travis.yml b/.travis.yml index 6bb54b231..00842ed68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,15 @@ script: after_success: - ./gradlew jacocoTestReport coveralls - ./gradlew uploadArchives -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" - -after_script: -- bash travis/publish_docker_image.sh +- pushd 'jaeger-java-crossdock' +- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" +- export REPO=jaegertracing/xdock-java +- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST +- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; 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 diff --git a/travis/publish_docker_image.sh b/travis/publish_docker_image.sh deleted file mode 100644 index d11b68e8b..000000000 --- a/travis/publish_docker_image.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -set -e -set -x - -pushd 'jaeger-java-crossdock' - -export REPO=jaegertracing/xdock-java -export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST -export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; 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 login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" -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