File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ set -eo pipefail
1010TYPE=" $1 "
1111PLATFORM_TYPE=$( uname -m)
1212
13- if [ -z ${ELASTIC_QUALIFIER+x} ]; then
14- QUALIFIER=" ${ELASTIC_QUALIFIER} "
15- export QUALIFIER
16- fi
17-
1813MAKE_GOAL=package
1914if [[ ${PLATFORM_TYPE} == " arm" || ${PLATFORM_TYPE} == " aarch64" ]]; then
2015 MAKE_GOAL=package-docker
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ PYTHON_BIN:=$(PYTHON_VENV_DIR)/bin
1919PYTHON =$(PYTHON_BIN ) /python
2020CURRENT_DIR =$(shell dirname $(shell readlink -f $(firstword $(MAKEFILE_LIST ) ) ) )
2121
22+ # Support DRA qualifier with the following environment variable.
23+ ELASTIC_QUALIFIER? =
24+
2225# Create a local config.mk file to override configuration.
2326-include config.mk
2427
@@ -38,7 +41,8 @@ APM_SERVER_BINARIES:= \
3841# Strip binary and inject the Git commit hash and timestamp.
3942LDFLAGS := \
4043 -s \
41- -X github.com/elastic/beats/v7/libbeat/version.commit=$(GITCOMMIT ) \
44+ -X github.com/elastic/apm-server/internal/version.qualifier=$(ELASTIC_QUALIFIER ) \
45+ -X github.com/elastic/beats/v7/libbeat/version.commit=$(ELASTIC_QUALIFIER ) \
4246 -X github.com/elastic/beats/v7/libbeat/version.buildTime=$(GITCOMMITTIMESTAMP )
4347
4448# Rule to build apm-server binaries, using Go's native cross-compilation.
Original file line number Diff line number Diff line change @@ -8,5 +8,11 @@ GITROOT ?= $(shell git rev-parse --show-toplevel)
88GOLANG_VERSION =$(shell cat $(GITROOT ) /.go-version)
99GOARCH: =$(shell go env GOARCH)
1010
11- APM_SERVER_VERSION =$(shell grep "const Version" $(GITROOT ) /internal/version/version.go | cut -d'=' -f2 | tr -d '" ')
11+ APM_SERVER_ONLY_VERSION =$(shell grep "const Version" $(GITROOT ) /internal/version/version.go | cut -d'=' -f2 | tr -d '" ')
12+ # DRA uses a qualifier to annotate the type of release (alpha, rc, etc)
13+ ifdef ELASTIC_QUALIFIER
14+ APM_SERVER_VERSION=$(APM_SERVER_ONLY_VERSION)-$(ELASTIC_QUALIFIER)
15+ else
16+ APM_SERVER_VERSION=$(APM_SERVER_ONLY_VERSION)
17+ endif
1218APM_SERVER_VERSION_MAJORMINOR =$(shell echo $(APM_SERVER_VERSION ) | sed 's/\(.* \..* \) \..*/\1/')
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ package version
1919
2020import (
2121 "fmt"
22- "os"
2322 "runtime/debug"
2423 "time"
2524)
@@ -44,11 +43,6 @@ func init() {
4443 }
4544 }
4645 }
47-
48- // DRA supports --qualifier, let's use it to set the qualifier
49- if envQualifier := os .Getenv ("QUALIFIER" ); envQualifier != "" {
50- qualifier = envQualifier
51- }
5246}
5347
5448// CommitHash returns the hash of the git commit used for the build.
@@ -69,5 +63,8 @@ func VCSModified() bool {
6963
7064// VersionWithSuffix returns the version and the qualifier.
7165func VersionWithQualifier () string {
72- return fmt .Sprintf ("%s%s" , Version , qualifier )
66+ if qualifier == "" {
67+ return Version
68+ }
69+ return fmt .Sprintf ("%s-%s" , Version , qualifier )
7370}
You can’t perform that action at this time.
0 commit comments