build-docker-push: allow override of quay repo

This commit is contained in:
Bobby Rullo 2015-08-26 14:23:49 -07:00
parent fa96fb3a33
commit eb65555fe7

View file

@ -1,13 +1,15 @@
#!/bin/bash -e #!/bin/bash -e
registry=quay.io
repo=$registry/coreos/dex DOCKER_REGISTRY=${DOCKER_REGISTRY:=quay.io}
DOCKER_REPO=${DOCKER_REPO:=coreos/dex}
repo=$DOCKER_REGISTRY/$DOCKER_REPO
if [ -v $DOCKER_USER ] || [ -v $DOCKER_PASSWORD ]; then if [ -v $DOCKER_USER ] || [ -v $DOCKER_PASSWORD ]; then
echo "env variables not set: DOCKER_USER, DOCKER_PASSWORD. skipping login, assuming creds in .dockercfg" echo "env variables not set: DOCKER_USER, DOCKER_PASSWORD. skipping login, assuming creds in .dockercfg"
else else
echo logging in as $DOCKER_USER echo logging in as $DOCKER_USER
docker login --username="$DOCKER_USER" --password="$DOCKER_PASSWORD" --email="docker.login@coreos.com" $registry docker login --username="$DOCKER_USER" --password="$DOCKER_PASSWORD" --email="docker.login@coreos.com" $DOCKER_REGISTRY
fi fi
git_sha=$(git rev-parse HEAD) git_sha=$(git rev-parse HEAD)