Skip to content

Commit

Permalink
ci: push image to dockerhub on master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
relnod committed Oct 7, 2018
1 parent be0ad44 commit 2c53107
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
GO111MODULE=off go get golang.org/x/tools/cmd/goimports
GO111MODULE=off go get golang.org/x/lint/golint
make verify
test:
docker:
- image: circleci/golang:1.11.1
Expand All @@ -23,9 +24,25 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
- run: make test

push-image-to-dockerhub:
docker:
- image: circleci/golang:1.11.1
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run: make push-docker
workflows:
version: 2
verify_and_test:
jobs:
- verify
- test
- push-image-to-dockerhub:
requires:
- test
- verify
filters:
branches:
only: master
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ build-docker:
# Builds and pushes the image to dockerhub
.PHONY: push-docker
push-docker: build-docker
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
echo "docker login"
@echo ${DOCKER_PWD} | docker login -u ${DOCKER_LOGIN} --password-stdin
docker push relnod/dotm:latest

export RULE ?= help
Expand Down

0 comments on commit 2c53107

Please sign in to comment.