forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_push.sh
executable file
·30 lines (24 loc) · 1.07 KB
/
docker_push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Do not ever set -x here, it is a security hazard as it will place the credentials below in the
# CircleCI logs.
set -e
if [[ -n "$CIRCLE_PULL_REQUEST" ]]; then
echo 'Ignoring PR branch for docker push.'
exit 0
fi
DOCKER_IMAGE_PREFIX="${DOCKER_IMAGE_PREFIX:-envoyproxy/envoy}"
# push the envoy image on tags or merge to master
if [[ -n "$CIRCLE_TAG" ]] || [[ "$AZP_BRANCH" = 'refs/heads/master' ]]; then
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"
for BUILD_TYPE in "" "-alpine" "-alpine-debug"; do
docker push "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}-dev:latest"
docker tag "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}-dev:latest" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}-dev:${CIRCLE_SHA1}"
docker push "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}-dev:${CIRCLE_SHA1}"
done
# 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.'
fi