-
Notifications
You must be signed in to change notification settings - Fork 527
/
Copy pathgo.mk
18 lines (16 loc) · 844 Bytes
/
go.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
GITDIR ?= $(shell git rev-parse --git-dir)
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITCOMMITTIMESTAMP ?= $(shell git log -1 --pretty=%cI)
GITCOMMITTIMESTAMPUNIX ?= $(shell git log -1 --pretty=%ct)
GITREFFILE ?= $(GITDIR)/$(shell git rev-parse --symbolic-full-name HEAD)
GITROOT ?= $(shell git rev-parse --show-toplevel)
GOLANG_VERSION=$(shell cat $(GITROOT)/.go-version)
GOARCH:=$(shell go env GOARCH)
APM_SERVER_ONLY_VERSION=$(shell grep "const Version" $(GITROOT)/internal/version/version.go | cut -d'=' -f2 | tr -d '" ')
# DRA uses a qualifier to annotate the type of release (alpha, rc, etc)
ifdef ELASTIC_QUALIFIER
APM_SERVER_VERSION=$(APM_SERVER_ONLY_VERSION)-$(ELASTIC_QUALIFIER)
else
APM_SERVER_VERSION=$(APM_SERVER_ONLY_VERSION)
endif
APM_SERVER_VERSION_MAJORMINOR=$(shell echo $(APM_SERVER_VERSION) | sed 's/\(.*\..*\)\..*/\1/')