Update makefile.

This commit is contained in:
Alex Myasoedov 2018-03-05 20:29:19 -05:00
parent c6b9f67933
commit 7f1d9619bc

View file

@ -1,19 +1,23 @@
GIT_SUMMARY := $(shell git describe --tags --dirty --always)
REPO=msoedov/hacker-slides
DOCKER_IMAGE := $(REPO):$(GIT_SUMMARY)
default: repo
repo:
@echo $(REPO):$(GIT_SUMMARY)
@echo $(DOCKER_IMAGE)
build:
@GOOS=linux CGO_ENABLE=0 go build main.go
@docker build -t $(REPO):$(GIT_SUMMARY) .
@docker tag $(REPO):$(GIT_SUMMARY) $(REPO)
@docker build -t $(DOCKER_IMAGE) .
@docker tag $(DOCKER_IMAGE) $(REPO)
push:
@docker push $(REPO):$(GIT_SUMMARY)
@docker push $(DOCKER_IMAGE)
@docker push $(REPO)
r:
@docker run -it -p 8080:8080 $(REPO):$(GIT_SUMMARY)
@docker run -it -p 8080:8080 $(DOCKER_IMAGE)
release:
@build
@push