forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push
executable file
·30 lines (21 loc) · 849 Bytes
/
push
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 -e
# Build, tag, and push container image to quay.io/coreos/tectonic-console
# Will push a sha-named image at every run.
# If it appears to be the tip of master, will tag that image with a
# git tag if one is present.
# This script relies on .dockercfg or other external configuration to
# grant the appropriate permissions and identity for pushing images quay.io
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd $SCRIPT_DIR
set -x
: ${REPO:=quay.io/coreos/tectonic-console}
GIT_VERSION=$(./git-version)
if [[ "$GIT_VERSION" == *dirty ]]; then
echo "Won't push from a dirty git repo. Commit your changes before you push."
exit 1
fi
docker build -q --rm=true -t $REPO:$GIT_VERSION .
docker tag $REPO:$GIT_VERSION $REPO:vdevel-latest
docker push $REPO:$GIT_VERSION
docker push $REPO:vdevel-latest
popd