Skip to content

Commit

Permalink
circleci conf: working with push to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles Crabill committed May 30, 2017
1 parent cd6a696 commit 0af4474
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
26 changes: 13 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ jobs:
working_directory: /socorro
command: make dockertest

# - run:
# name: Push to Dockerhub
# working_directory: /socorro
# command: |
# # set DOCKER_DEPLOY=true in Circle UI to push to Dockerhub
# DOCKER_DEPLOY="${DOCKER_DEPLOY:-false}"
# if [ "${CIRCLE_BRANCH}" == "master" ]; then
# bin/ci/deploy-dockerhub.sh latest
# bin/ci/deploy-dockerhub.sh "circle_build_$CIRCLE_BUILD_NUM"
# fi
# if [ -n "${CIRCLE_TAG}"]; then
# bin/ci/deploy-dockerhub.sh "$CIRCLE_TAG"j
# fi
- run:
name: Push to Dockerhub
working_directory: /socorro
command: |
# set DOCKER_DEPLOY=true in Circle UI to push to Dockerhub
DOCKER_DEPLOY="${DOCKER_DEPLOY:-false}"
if [ "${CIRCLE_BRANCH}" == "master" ]; then
bin/ci/deploy-dockerhub.sh latest
bin/ci/deploy-dockerhub.sh "circle_build_$CIRCLE_BUILD_NUM"
fi
if [ -n "${CIRCLE_TAG}"]; then
bin/ci/deploy-dockerhub.sh "$CIRCLE_TAG"j
fi
6 changes: 3 additions & 3 deletions bin/ci/deploy-dockerhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ retry 3 docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWO
if [ -n "$1" ]; then
[ "$1" == master ] && TAG=latest || TAG="$1"
for image in "socorro_processor" "socorro_webapp"; do
docker tag "$image:latest" "mozilla/$image:$TAG" ||
(echo "Couldn't tag $image:latest as mozilla/$image:$TAG" && false)
retry 3 docker push "mozilla/socorro:$TAG" ||
docker tag "local/$image:latest" "mozilla/$image:$TAG" ||
(echo "Couldn't tag local/$image:latest as mozilla/$image:$TAG" && false)
retry 3 docker push "mozilla/$image:$TAG" ||
(echo "Couldn't push mozilla/$image:$TAG" && false)
echo "Pushed mozilla/$image:$TAG"
done
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
build:
context: .
dockerfile: ./docker/Dockerfile.processor
image: local/socorro_processor
env_file:
- docker/config/docker_common.env
- docker/config/processor.env
Expand Down

0 comments on commit 0af4474

Please sign in to comment.