Skip to content

Commit

Permalink
search for BUILD_VERSION only on current branch history
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Dec 13, 2022
1 parent 94c00c5 commit 41dd6cb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ PREFIX?="/"
PID_DIR = $(PREFIX)"/var/run/"
BINARY_NAME=crowdsec-custom-bouncer


#Current versioning information from env
BUILD_VERSION?="$(shell git describe --tags `git rev-list --tags --max-count=1`)"
BUILD_VERSION?="$(shell git describe --tags)"
BUILD_GOVERSION="$(shell go version | cut -d " " -f3 | sed -r 's/[go]+//g')"
BUILD_TIMESTAMP=$(shell date +%F"_"%T)
BUILD_TAG="$(shell git rev-parse HEAD)"

export LD_OPTS=-ldflags "-s -w -X github.com/crowdsecurity/crowdsec-custom-bouncer/pkg/version.Version=$(BUILD_VERSION) \
-X github.com/crowdsecurity/crowdsec-custom-bouncer/pkg/version.BuildDate=$(BUILD_TIMESTAMP) \
-X github.com/crowdsecurity/crowdsec-custom-bouncer/pkg/version.Tag=$(BUILD_TAG) \
-X github.com/crowdsecurity/crowdsec-custom-bouncer/pkg/version.GoVersion=$(BUILD_GOVERSION)"

RELDIR = "crowdsec-custom-bouncer-${BUILD_VERSION}"


all: clean test build

static: clean
Expand All @@ -40,7 +39,6 @@ clean:
@rm -rf ${RELDIR}
@rm -f crowdsec-custom-bouncer.tgz || ""


.PHONY: release
release: build
@if [ -z ${BUILD_VERSION} ] ; then BUILD_VERSION="local" ; fi
Expand All @@ -56,4 +54,4 @@ release: build
@chmod +x $(RELDIR)/uninstall.sh
@chmod +x $(RELDIR)/upgrade.sh
@tar cvzf crowdsec-custom-bouncer.tgz $(RELDIR)


0 comments on commit 41dd6cb

Please sign in to comment.