Skip to content

Commit

Permalink
docker push image of branch develop
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie-5miles committed May 9, 2018
1 parent 2d0c526 commit d0f281e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ after_success:
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ;
make push_image ;
elif [[ "$TRAVIS_BRANCH" == "develop" ]]; then
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ;
make push_dev_image ;
fi
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,22 @@ tools:
build: get_vendor_deps
go build -o build/travis ./cmd/travis

IMAGE := ywonline/travis
NAME := ywonline/travis
TAG := $(shell git rev-parse --short=8 HEAD)
IMAGE := ${NAME}:${TAG}
LATEST := ${NAME}:latest

docker_image:
docker build -t $(IMAGE) .
@docker build -t $(IMAGE) .
@docker tag ${IMAGE} ${LATEST}

DEV := ${NAME}:develop
push_dev_image:
@docker tag $(IMAGE) ${DEV}
@docker push $(DEV)

push_image:
docker push $(IMAGE)
@docker push $(LATEST)

print_cybermiles_logo:
@echo "\n\n"
Expand Down

0 comments on commit d0f281e

Please sign in to comment.