-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
64 lines (48 loc) · 2.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
GOBIN := $(shell go env GOPATH)/bin
KIND_APP_IP ?= $(shell make -sC _run/kube kind-k8s-ip)
KIND_APP_PORT ?= $(shell make -sC _run/kube app-http-port)
KIND_VARS ?= KUBE_INGRESS_IP="$(KIND_APP_IP)" KUBE_INGRESS_PORT="$(KIND_APP_PORT)"
LEDGER_ENABLED ?= true
include make/init.mk
.DEFAULT_GOAL := bins
DOCKER_RUN := docker run --rm -v $(shell pwd):/workspace -w /workspace
GOLANGCI_LINT_RUN := $(GOLANGCI_LINT) run
LINT = $(GOLANGCI_LINT_RUN) ./... --disable-all --deadline=5m --enable
GORELEASER_CONFIG ?= .goreleaser.yaml
GIT_HEAD_COMMIT_LONG := $(shell git log -1 --format='%H')
GIT_HEAD_COMMIT_SHORT := $(shell git rev-parse --short HEAD)
GIT_HEAD_ABBREV := $(shell git rev-parse --abbrev-ref HEAD)
RELEASE_TAG ?= $(shell git describe --tags --abbrev=0)
IS_PREREL := $(shell $(ROOT_DIR)/script/is_prerelease.sh "$(RELEASE_TAG)" && echo "true" || echo "false")
GO_LINKMODE ?= external
BUILD_TAGS ?= osusergo,netgo,static_build
GORELEASER_STRIP_FLAGS ?=
GO_LINKMODE ?= external
ifeq ($(LEDGER_ENABLED),true)
BUILD_TAGS := $(BUILD_TAGS),ledger
endif
GORELEASER_BUILD_VARS := \
-X github.com/akash-network/provider/version.Name=provider-services \
-X github.com/akash-network/provider/version.AppName=provider-services \
-X github.com/akash-network/provider/version.BuildTags=\"$(BUILD_TAGS)\" \
-X github.com/akash-network/provider/version.Version=$(RELEASE_TAG) \
-X github.com/akash-network/provider/version.Commit=$(GIT_HEAD_COMMIT_LONG)
ldflags = -linkmode=$(GO_LINKMODE) \
-X github.com/akash-network/provider/version.Name=provider-services \
-X github.com/akash-network/provider/version.AppName=provider-services \
-X github.com/akash-network/provider/version.BuildTags="$(BUILD_TAGS)" \
-X github.com/akash-network/provider/version.Version=$(shell git describe --tags) \
-X github.com/akash-network/provider/version.Commit=$(GIT_HEAD_COMMIT_LONG)
# check for nostrip option
ifeq (,$(findstring nostrip,$(BUILD_OPTIONS)))
ldflags += -s -w
GORELEASER_STRIP_FLAGS += -s -w
endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))
BUILD_FLAGS := -mod=$(GO_MOD) -tags='$(BUILD_TAGS)' -ldflags '$(ldflags)'
include make/releasing.mk
include make/mod.mk
include make/lint.mk
include make/test-integration.mk
include make/codegen.mk