Skip to content

Commit

Permalink
Update publish to work like docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
expelledboy committed Feb 26, 2020
1 parent 97dbf06 commit 2da5b68
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ IMAGE = $(REGISTRY)/$(USERNAME)/$(NAME)
help: ## Print help messages
@sed -n 's/^\([a-zA-Z_-]*\):.*## \(.*\)$$/\1 -- \2/p' Makefile

build: VERSION = $(shell git describe --always)
build: ## Build docker image
docker build -t $(IMAGE) .
docker tag $(IMAGE):latest $(IMAGE):$(VERSION)

test: ## Run simple unit test
docker run -d --rm \
Expand Down Expand Up @@ -43,9 +41,15 @@ bump: IMPACT = patch
bump:
npm version $(IMPACT)

publish: VERSION = $(shell git describe --always)
publish: VERSION = $(shell git describe --always | tr -d v)
publish: MINOR = $(shell echo $(VERSION) | sed -n 's/^\(.\..\).*/\1/p')
publish: on-tag build ## Push docker image to $(REGISTRY)
docker tag $(IMAGE):latest $(IMAGE):$(VERSION)
docker tag $(IMAGE):latest $(IMAGE):$(MINOR)
docker push $(IMAGE):$(VERSION)
docker push $(IMAGE):$(MINOR)
docker rmi $(IMAGE):$(VERSION)
docker rmi $(IMAGE):$(MINOR)
docker push $(IMAGE):latest

# ==
Expand Down

0 comments on commit 2da5b68

Please sign in to comment.