Skip to content

Commit

Permalink
ci docker: split dev images into "*-dev" docker hub repos (#6328)
Browse files Browse the repository at this point in the history
This will make tagged version images more easily discoverable.

Fixes #4052

Signed-off-by: Matt Klein <[email protected]>
  • Loading branch information
mattklein123 authored and htuch committed Apr 5, 2019
1 parent 7eb739e commit ea248e2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 36 deletions.
6 changes: 3 additions & 3 deletions ci/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -ex

docker build -f ci/Dockerfile-envoy-image -t envoyproxy/envoy:latest .
docker build -f ci/Dockerfile-envoy-alpine -t envoyproxy/envoy-alpine:latest .
docker build -f ci/Dockerfile-envoy-alpine-debug -t envoyproxy/envoy-alpine-debug:latest .
docker build -f ci/Dockerfile-envoy-image -t envoyproxy/envoy-dev:latest .
docker build -f ci/Dockerfile-envoy-alpine -t envoyproxy/envoy-alpine-dev:latest .
docker build -f ci/Dockerfile-envoy-alpine-debug -t envoyproxy/envoy-alpine-debug-dev:latest .
34 changes: 14 additions & 20 deletions ci/docker_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,25 @@ set -e

if [ -n "$CIRCLE_PULL_REQUEST" ]
then
echo 'Ignoring PR branch for docker push.'
exit 0
echo 'Ignoring PR branch for docker push.'
exit 0
fi

# push the envoy image on tags or merge to master
if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" == 'master' ]
if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = 'master' ]
then
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"

docker push envoyproxy/envoy:latest
docker tag envoyproxy/envoy:latest envoyproxy/envoy:"$CIRCLE_SHA1"
docker push envoyproxy/envoy:"$CIRCLE_SHA1"
for BUILD_TYPE in "envoy" "envoy-alpine" "envoy-alpine-debug"; do
docker push envoyproxy/"$BUILD_TYPE"-dev:latest
docker tag envoyproxy/"$BUILD_TYPE"-dev:latest envoyproxy/"$BUILD_TYPE"-dev:"$CIRCLE_SHA1"
docker push envoyproxy/"$BUILD_TYPE"-dev:"$CIRCLE_SHA1"
done

docker tag envoyproxy/envoy-alpine:latest envoyproxy/envoy-alpine:"$CIRCLE_SHA1"
docker push envoyproxy/envoy-alpine:"$CIRCLE_SHA1"
docker push envoyproxy/envoy-alpine:latest

docker tag envoyproxy/envoy-alpine-debug:latest envoyproxy/envoy-alpine-debug:"$CIRCLE_SHA1"
docker push envoyproxy/envoy-alpine-debug:"$CIRCLE_SHA1"
docker push envoyproxy/envoy-alpine-debug:latest

# This script tests the docker examples.
# TODO(mattklein123): This almost always times out on CircleCI. Do not run for now until we
# have a better CI setup.
#./ci/verify_examples.sh
# This script tests the docker examples.
# TODO(mattklein123): This almost always times out on CircleCI. Do not run for now until we
# have a better CI setup.
#./ci/verify_examples.sh
else
echo 'Ignoring non-master branch for docker push.'
echo 'Ignoring non-master branch for docker push.'
fi
22 changes: 9 additions & 13 deletions ci/docker_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ set -e

if [ -n "$CIRCLE_TAG" ]
then
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"

docker pull envoyproxy/envoy:"$CIRCLE_SHA1"
docker tag envoyproxy/envoy:"$CIRCLE_SHA1" envoyproxy/envoy:"$CIRCLE_TAG"
docker push envoyproxy/envoy:"$CIRCLE_TAG"

docker pull envoyproxy/envoy-alpine:"$CIRCLE_SHA1"
docker tag envoyproxy/envoy-alpine:"$CIRCLE_SHA1" envoyproxy/envoy-alpine:"$CIRCLE_TAG"
docker push envoyproxy/envoy-alpine:"$CIRCLE_TAG"

docker pull envoyproxy/envoy-alpine-debug:"$CIRCLE_SHA1"
docker tag envoyproxy/envoy-alpine-debug:"$CIRCLE_SHA1" envoyproxy/envoy-alpine-debug:"$CIRCLE_TAG"
docker push envoyproxy/envoy-alpine-debug:"$CIRCLE_TAG"
for BUILD_TYPE in "envoy" "envoy-alpine" "envoy-alpine-debug"; do
docker pull envoyproxy/"$BUILD_TYPE"-dev:"$CIRCLE_SHA1"
docker tag envoyproxy/"$BUILD_TYPE"-dev:"$CIRCLE_SHA1" envoyproxy/"$BUILD_TYPE":"$CIRCLE_TAG"
docker push envoyproxy/"$BUILD_TYPE":"$CIRCLE_TAG"
docker tag envoyproxy/"$BUILD_TYPE"-dev:"$CIRCLE_SHA1" envoyproxy/"$BUILD_TYPE":latest
docker push envoyproxy/"$BUILD_TYPE":latest
done
else
echo 'Ignoring non-tag event for docker tag.'
echo 'Ignoring non-tag event for docker tag.'
fi

0 comments on commit ea248e2

Please sign in to comment.