Skip to content

Instantly share code, notes, and snippets.

@fizruk
Created November 10, 2015 17:12
Show Gist options
  • Save fizruk/d079c69c277a9b6979d2 to your computer and use it in GitHub Desktop.
Save fizruk/d079c69c277a9b6979d2 to your computer and use it in GitHub Desktop.
Push to Docker from Circle CI
#!/bin/sh
set -x
CIRCLE_TAG=`git name-rev --tags --name-only $(git rev-parse HEAD)`
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
if [ "$CIRCLE_TAG" -ne "undefined" ]; then
docker tag user/repo user/repo:$CIRCLE_TAG
fi
docker tag user/repo user/repo:$CIRCLE_BRANCH
docker push user/repo
@dmjio
Copy link

dmjio commented Jan 11, 2016

@fizruk

Was docker tag user/repo user/repo:$CIRCLE_BRANCH meant to be $CIRCLE_BRANCH or $CIRCLE_TAG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment