Makefile does not require go to run tests (#1663)
This commit is contained in:
parent
24b1a99c42
commit
85e5a7e8ed
3
Makefile
3
Makefile
|
@ -43,9 +43,6 @@ CROWDSEC_BIN = crowdsec$(EXT)
|
||||||
CSCLI_BIN = cscli$(EXT)
|
CSCLI_BIN = cscli$(EXT)
|
||||||
BUILD_CMD = build
|
BUILD_CMD = build
|
||||||
|
|
||||||
GOOS ?= $(shell go env GOOS)
|
|
||||||
GOARCH ?= $(shell go env GOARCH)
|
|
||||||
|
|
||||||
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
|
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
|
||||||
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 17
|
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 17
|
||||||
GO_VERSION_VALIDATION_ERR_MSG = Golang version ($(BUILD_GOVERSION)) is not supported, please use at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
|
GO_VERSION_VALIDATION_ERR_MSG = Golang version ($(BUILD_GOVERSION)) is not supported, please use at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
|
||||||
|
|
|
@ -4,10 +4,14 @@ CP=cp
|
||||||
CPR=cp -r
|
CPR=cp -r
|
||||||
MKDIR=mkdir -p
|
MKDIR=mkdir -p
|
||||||
|
|
||||||
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
|
# Go should not be required to run functional tests
|
||||||
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
GOOS ?= $(shell command -v go >/dev/null && go env GOOS)
|
||||||
|
GOARCH ?= $(shell command -v go >/dev/null && go env GOARCH)
|
||||||
|
|
||||||
BUILD_GOVERSION="$(shell go version | cut -d " " -f3 | sed -E 's/[go]+//g')"
|
GO_MAJOR_VERSION = $(shell command -v go >/dev/null && go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
|
||||||
|
GO_MINOR_VERSION = $(shell command -v go >/dev/null && go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
||||||
|
|
||||||
|
BUILD_GOVERSION="$(shell command -v go >/dev/null && go version | cut -d " " -f3 | sed -E 's/[go]+//g')"
|
||||||
|
|
||||||
#Current versioning information from env
|
#Current versioning information from env
|
||||||
BUILD_VERSION?="$(shell git describe --tags $$(git rev-list --tags --max-count=1))"
|
BUILD_VERSION?="$(shell git describe --tags $$(git rev-list --tags --max-count=1))"
|
||||||
|
@ -15,4 +19,4 @@ BUILD_CODENAME="alphaga"
|
||||||
BUILD_TIMESTAMP=$(shell date +%F"_"%T)
|
BUILD_TIMESTAMP=$(shell date +%F"_"%T)
|
||||||
BUILD_TAG?="$(shell git rev-parse HEAD)"
|
BUILD_TAG?="$(shell git rev-parse HEAD)"
|
||||||
DEFAULT_CONFIGDIR?=/etc/crowdsec
|
DEFAULT_CONFIGDIR?=/etc/crowdsec
|
||||||
DEFAULT_DATADIR?=/var/lib/crowdsec/data
|
DEFAULT_DATADIR?=/var/lib/crowdsec/data
|
||||||
|
|
|
@ -5,6 +5,9 @@ MAKE=make
|
||||||
GOOS=windows
|
GOOS=windows
|
||||||
PREFIX=$(shell $$env:TEMP)
|
PREFIX=$(shell $$env:TEMP)
|
||||||
|
|
||||||
|
GOOS ?= $(shell go env GOOS)
|
||||||
|
GOARCH ?= $(shell go env GOARCH)
|
||||||
|
|
||||||
GO_MAJOR_VERSION ?= $(shell (go env GOVERSION).replace("go","").split(".")[0])
|
GO_MAJOR_VERSION ?= $(shell (go env GOVERSION).replace("go","").split(".")[0])
|
||||||
GO_MINOR_VERSION ?= $(shell (go env GOVERSION).replace("go","").split(".")[1])
|
GO_MINOR_VERSION ?= $(shell (go env GOVERSION).replace("go","").split(".")[1])
|
||||||
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
|
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
|
||||||
|
|
Loading…
Reference in a new issue