2015-08-18 05:57:27 +05:30
|
|
|
#!/bin/bash -e
|
|
|
|
|
2015-08-27 02:53:49 +05:30
|
|
|
|
|
|
|
DOCKER_REGISTRY=${DOCKER_REGISTRY:=quay.io}
|
|
|
|
DOCKER_REPO=${DOCKER_REPO:=coreos/dex}
|
|
|
|
repo=$DOCKER_REGISTRY/$DOCKER_REPO
|
2015-08-18 05:57:27 +05:30
|
|
|
|
|
|
|
if [ -v $DOCKER_USER ] || [ -v $DOCKER_PASSWORD ]; then
|
|
|
|
echo "env variables not set: DOCKER_USER, DOCKER_PASSWORD. skipping login, assuming creds in .dockercfg"
|
|
|
|
else
|
|
|
|
echo logging in as $DOCKER_USER
|
2015-12-08 04:25:25 +05:30
|
|
|
docker login --username="$DOCKER_USER" --password="$DOCKER_PASSWORD" --email="dex@example.com" $DOCKER_REGISTRY
|
2015-08-18 05:57:27 +05:30
|
|
|
fi
|
|
|
|
|
2015-12-17 03:58:20 +05:30
|
|
|
version=$(./git-version)
|
2015-08-18 05:57:27 +05:30
|
|
|
|
2015-12-17 03:58:20 +05:30
|
|
|
docker build -q --rm=true -t $repo:$version .
|
|
|
|
docker tag -f $repo:$version $repo:latest
|
|
|
|
docker push $repo:$version
|
2015-08-18 05:57:27 +05:30
|
|
|
docker push $repo:latest
|