From 803104578fe7942e3459238d93a0ee2719ef9d56 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Wed, 13 Jul 2022 13:17:23 +0300 Subject: [PATCH] Add `make build-dev` command Signed-off-by: Stefan Prodan --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 7942926d..8daf0426 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ VERSION?=$(shell grep 'VERSION' cmd/flux/main.go | awk '{ print $$4 }' | head -n 1 | tr -d '"') +DEV_VERSION?=0.0.0-$(shell git rev-parse --abbrev-ref HEAD)-$(shell git rev-parse --short HEAD)-$(shell date +%s) EMBEDDED_MANIFESTS_TARGET=cmd/flux/.manifests.done TEST_KUBECONFIG?=/tmp/flux-e2e-test-kubeconfig # Architecture to use envtest with @@ -55,6 +56,9 @@ $(EMBEDDED_MANIFESTS_TARGET): $(call rwildcard,manifests/,*.yaml *.json) build: $(EMBEDDED_MANIFESTS_TARGET) CGO_ENABLED=0 go build -ldflags="-s -w -X main.VERSION=$(VERSION)" -o ./bin/flux ./cmd/flux +build-dev: $(EMBEDDED_MANIFESTS_TARGET) + CGO_ENABLED=0 go build -ldflags="-s -w -X main.VERSION=$(DEV_VERSION)" -o ./bin/flux ./cmd/flux + .PHONY: install install: CGO_ENABLED=0 go install ./cmd/flux