Skip to content

Commit

Permalink
Do not tag Dicker images with SHA and travis build number tags (#376)
Browse files Browse the repository at this point in the history
except for crossdock images
  • Loading branch information
pavolloffay authored and yurishkuro committed Sep 8, 2017
1 parent 4fbabcc commit f0193c6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 25 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions crossdock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ services:

test_driver:
build: .
image: jaegertracing/test_driver:latest
links:
- cassandra
depends_on:
Expand Down
5 changes: 1 addition & 4 deletions crossdock/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions travis/build-all-in-one-image.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions travis/build-crossdock.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion travis/build-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 12 additions & 14 deletions travis/upload-to-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit f0193c6

Please sign in to comment.