forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_push.sh
executable file
·30 lines (25 loc) · 977 Bytes
/
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/sh
# 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
# push the envoy image on tags or merge to master
if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = 'master' ]
then
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"
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
# 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