diff options
Diffstat (limited to 'tools/govanity/Makefile')
-rw-r--r-- | tools/govanity/Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/govanity/Makefile b/tools/govanity/Makefile index 48eb9b4..9632386 100644 --- a/tools/govanity/Makefile +++ b/tools/govanity/Makefile @@ -5,21 +5,25 @@ DOCKER_IMAGE_REF := $(shell git rev-parse HEAD) DOCKERFILE := Dockerfile PROJECT_DIR := $(realpath $(CURDIR)) -.PHONY: deploy docker-build docker-run +.PHONY: deploy docker-build docker-run worktree-clean server server: @echo "Running server ..." go run . -deploy: docker-build +worktree-clean: + git diff --exit-code + git diff --staged --exit-code + +deploy: worktree-clean docker-build @echo "Deploying to fly ..." - flyctl deploy --build-arg IMAGE_REF=$(DOCKER_IMAGE_REF) + flyctl deploy + git tag -a --message $$(flyctl info -j |jq -r '.App | "\(.Name)/v\(.Version)"') $$(flyctl info -j |jq -r '.App | "\(.Name)/v\(.Version)"') docker-build: @echo "Building Docker image ..." $(DOCKER) build $(DOCKER_BUILD_ARGS) \ --tag "${DOCKER_IMAGE}:${DOCKER_IMAGE_REF}" \ - --build-arg IMAGE_REF=$(DOCKER_IMAGE_REF) \ --file "$(DOCKERFILE)" \ "$(PROJECT_DIR)" |