mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
641 B
20 lines
641 B
#!/bin/bash -e |
|
|
|
|
|
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 |
|
echo "env variables not set: DOCKER_USER, DOCKER_PASSWORD. skipping login, assuming creds in .dockercfg" |
|
else |
|
echo logging in as $DOCKER_USER |
|
docker login --username="$DOCKER_USER" --password="$DOCKER_PASSWORD" --email="docker.login@coreos.com" $DOCKER_REGISTRY |
|
fi |
|
|
|
git_sha=$(git rev-parse HEAD) |
|
|
|
docker build -q --rm=true -t $repo:$git_sha . |
|
docker tag -f $repo:$git_sha $repo:latest |
|
docker push $repo:$git_sha |
|
docker push $repo:latest
|
|
|