Skip to content

Commit

Permalink
circle.yml: deploy non-master branches
Browse files Browse the repository at this point in the history
By default, non-master branches are not deployed on the Docker Hub. With
this patch, you can enable this feature by setting the environment
variable DEPLOY_BRANCH in the circle configuration.

It will not be tagged with the "latest" tag but instead derive the tag
from the branch name. Since "/" are not allowed in Docker tag names, all
"/" are replaced by "-".

When testing code in Scope, I use circle to build the Docker image but I
don't want to always use my "master" branch for development.
  • Loading branch information
alban committed May 27, 2016
1 parent 277bd70 commit a0d9df2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ deployment:
(test "${DOCKER_ORGANIZATION:-$DOCKER_USER}" == "weaveworks" || docker tag weaveworks/scope:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:latest) &&
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope
)
hub-dev:
branch: /^((?!master).)*$/ # not the master branch
commands:
- >
test -z "${DEPLOY_BRANCH}" || test -z "${DOCKER_USER}" || (
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS &&
docker tag weaveworks/scope:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:${CIRCLE_BRANCH//\//-} &&
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:${CIRCLE_BRANCH//\//-}
)
# release:
# branch: /release-[0-9]+\.[0-9]+/
# owner: weaveworks
Expand Down

0 comments on commit a0d9df2

Please sign in to comment.