From 3161b0a05d07dfaada45dffd83b37672231edb9f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 9 Sep 2021 18:13:05 -0700 Subject: build: tag correctly the release The version was evaluated before the deploy was done, we need to get that information after running `flyctl deploy`. Annotate the tag since we're doing a release. Remove the argument `IMAGE_REF` since it's being ignored. --- tools/govanity/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tools/govanity') 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)" -- cgit 1.4.1