diff --git a/.travis.yml b/.travis.yml index ec0a07b8b29..96118d41b60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ env: - secure: XNFxKWRKZLqcM7cceyN3jGZmaisdwNCSG+9b4eq3h022llrRd11Zaxp3JDbVqXtsHDiC9lzuI41dyiRphO4KwXKysawpJicNS1ZymkiITaF/blNAcncIS5NMsEbszDbwiP+FjqHdnMloGpSa3aEz2ehVEBaW7kiH49ayRWVs7GKV2OeH7V16B1116y5KvFiniDY/m/ycBd3K7HqKRuGx4EvlMIUbq0IFpl2N1dcrOFTDGTm8qzGTOwGqCQc/1NfllB7Iv2mkdu6dWhEyhRVOdXEWbwqU4Hjn/ugnAKQ1NnukaYmwgKM1WUba5cu1nFpCyMwp5tiGSef1UqXM380wrQkUvPNyiM4MD4hX0ab3bZxtd8TmlTLyDBE4Q+CaJoZzcbqRwi0B4CSFCLvm17GRmjB9iY8w/ig3bEndDFzLua7tx0MMPQVHOG0fjB1chCdOOfzcmdvIiCpVmmVKfuodulHN/6yWCi8XHWLee8L20zNxyVPbPT0XOnlkQZrnjZMyYvrpFaw3J6EKCnduk3GhHYI5RigJk2xorRiXgeN9DkFw/TuBIV3CMHi6sbgiNIv15CLO0ZGlUJnF+q4u5o9qUT/XSykNn0+Z/2ABMIJvS496gU3OT7RbjmuZforqyvCniMow4hDiE8MtZMBYOSmM1CiHQb413/kPgUjYQ2ajnuU= install: + - docker rmi $(docker images -q) || true - make install_ci - if [ "$ALL_IN_ONE" == true ]; then bash ./travis/install-ui-deps.sh ; fi - if [ "$DOCKER" == true ]; then bash ./travis/install-ui-deps.sh ; fi diff --git a/Makefile b/Makefile index 70af95c09e2..31ba9f94fe8 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ PASS=$(shell printf "\033[32mPASS\033[0m") FAIL=$(shell printf "\033[31mFAIL\033[0m") COLORIZE=sed ''/PASS/s//$(PASS)/'' | sed ''/FAIL/s//$(FAIL)/'' DOCKER_NAMESPACE?=$(USER) -DOCKER_TAG?=local +DOCKER_TAG?=latest .DEFAULT_GOAL := test-and-lint diff --git a/crossdock/docker-compose.yml b/crossdock/docker-compose.yml index 883d12e2ebc..654f156041b 100644 --- a/crossdock/docker-compose.yml +++ b/crossdock/docker-compose.yml @@ -65,6 +65,7 @@ services: test_driver: build: . + image: jaegertracing/test_driver:latest links: - cassandra depends_on: diff --git a/crossdock/rules.mk b/crossdock/rules.mk index 1c8ae3bd7fa..cd7c1687763 100644 --- a/crossdock/rules.mk +++ b/crossdock/rules.mk @@ -44,10 +44,7 @@ crossdock: $(SCHEMA) crossdock-copy-bin .PHONY: crossdock-fresh crossdock-fresh: $(SCHEMA) crossdock-copy-bin - docker-compose -f $(XDOCK_YAML) kill - docker-compose -f $(XDOCK_YAML) rm --force - docker-compose -f $(XDOCK_YAML) pull - docker-compose -f $(XDOCK_YAML) build + docker-compose -f $(XDOCK_YAML) down --rmi all docker-compose -f $(XDOCK_YAML) run crossdock .PHONE: crossdock-logs diff --git a/travis/build-all-in-one-image.sh b/travis/build-all-in-one-image.sh old mode 100644 new mode 100755 index dfb91329e6a..7595fb9a6ce --- a/travis/build-all-in-one-image.sh +++ b/travis/build-all-in-one-image.sh @@ -10,13 +10,13 @@ make build-all-in-one-linux export REPO=jaegertracing/all-in-one -docker build -f cmd/standalone/Dockerfile -t $REPO:$COMMIT . -export CID=$(docker run -d -p 16686:16686 $REPO:$COMMIT) +docker build -f cmd/standalone/Dockerfile -t $REPO:latest . +export CID=$(docker run -d -p 16686:16686 $REPO:latest) make integration-test docker kill $CID # Only push the docker container to Docker Hub for master branch -if [[ "$BRANCH" == "master" && "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then +if [[ ("$BRANCH" == "master" || $BRANCH =~ ^v[0-9]+\.[0-9]+\.[0-9]+$) && "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then echo 'upload to Docker Hub' else echo 'skip docker upload for PR' diff --git a/travis/build-crossdock.sh b/travis/build-crossdock.sh old mode 100644 new mode 100755 index d49aabbeb8d..2bf36762d00 --- a/travis/build-crossdock.sh +++ b/travis/build-crossdock.sh @@ -14,7 +14,7 @@ else exit 0 fi +# docker image has been build when running the crossdock export REPO=jaegertracing/test-driver -docker build -t $REPO:$COMMIT ./crossdock - +docker tag $REPO:latest $REPO:$COMMIT bash ./travis/upload-to-docker.sh diff --git a/travis/build-docker-images.sh b/travis/build-docker-images.sh index 3126150f6f2..cfc05427629 100755 --- a/travis/build-docker-images.sh +++ b/travis/build-docker-images.sh @@ -21,7 +21,6 @@ source ~/.nvm/nvm.sh nvm use 6 export DOCKER_NAMESPACE=jaegertracing -export DOCKER_TAG=${COMMIT:?'missing COMMIT env var'} make docker for component in agent cassandra-schema collector query diff --git a/travis/upload-to-docker.sh b/travis/upload-to-docker.sh index ef501ca0922..ba2df97c0e1 100644 --- a/travis/upload-to-docker.sh +++ b/travis/upload-to-docker.sh @@ -3,7 +3,7 @@ set -e BRANCH=${BRANCH:?'missing BRANCH env var'} -IMAGE="${REPO:?'missing REPO env var'}:${COMMIT:?'missing COMMIT env var'}" +IMAGE="${REPO:?'missing REPO env var'}:latest" unset major minor patch if [[ "$BRANCH" == "master" ]]; then @@ -20,21 +20,19 @@ else fi echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, BRANCH=$BRANCH, TAG=$TAG, IMAGE=$IMAGE" -DOCKER=docker -$DOCKER login -u $DOCKER_USER -p $DOCKER_PASS - -# Do not enable echo before the `docker login` command to avoid revealing the password. -set -x - -$DOCKER tag $IMAGE $REPO:$TAG -$DOCKER tag $IMAGE $REPO:travis-$TRAVIS_BUILD_NUMBER -# add major and major.minor as aliases +# add major, major.minor and major.minor.patch tags if [[ -n $major ]]; then - $DOCKER tag $IMAGE $REPO:$major + docker tag $IMAGE $REPO:${major} if [[ -n $minor ]]; then - $DOCKER tag $IMAGE $REPO:${major}.${minor} + docker tag $IMAGE $REPO:${major}.${minor} + if [[ -n $patch ]]; then + docker tag $IMAGE $REPO:${major}.${minor}.${patch} + fi fi fi -# TOOO why are we pushing as $REPO instead of $IMAGE? -$DOCKER push $REPO +# Do not enable echo before the `docker login` command to avoid revealing the password. +set -x +docker login -u $DOCKER_USER -p $DOCKER_PASS +# push all tags, therefore push to repo +docker push $REPO