forked from PANTHEONtech/cnf-nsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (48 loc) · 1.86 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
65
66
IMAGE_REPO := "pantheontech"
VPP_VERSION := "20.01"
VERSION := $(shell git describe --always --tags --dirty)
COMMIT := $(shell git rev-parse HEAD)
DATE := $(shell date +'%Y-%m-%dT%H:%M%:z')
CNINFRA_AGENT := github.com/ligato/cn-infra/agent
LDFLAGS := -s -w -X $(CNINFRA_AGENT).BuildVersion=$(VERSION) -X $(CNINFRA_AGENT).CommitHash=$(COMMIT) -X $(CNINFRA_AGENT).BuildDate=$(DATE)
CRDGEN_DEPS_DIR := "crdgen"
LINTER := $(shell golangci-lint --version 2>/dev/null)
cnf-crd:
@echo "# building cnf-crd"
cd cmd/cnf-crd && go build -v -ldflags "${LDFLAGS}" -tags="${GO_BUILD_TAGS}"
cnf-crd-image:
./scripts/build-cnf-crd-image.sh $(IMAGE_REPO)
nsm-agent-vpp:
@echo "# building nsm-agent-vpp"
cd cmd/nsm-agent-vpp && go build -v -ldflags "${LDFLAGS}" -tags="${GO_BUILD_TAGS}"
nsm-agent-linux:
@echo "# building nsm-agent-linux"
cd cmd/nsm-agent-linux && go build -v -ldflags "${LDFLAGS}" -tags="${GO_BUILD_TAGS}"
nsm-agent-vpp-image:
./scripts/build-vpp-agent-image.sh $(IMAGE_REPO) $(VPP_VERSION)
nsm-agent-linux-image:
./scripts/build-linux-agent-image.sh $(IMAGE_REPO)
dep-install:
go mod download
get-desc-adapter-generator:
go install github.com/ligato/vpp-agent/plugins/kvscheduler/descriptor-adapter
gen: get-desc-adapter-generator dep-install
./scripts/gen-proto.sh
cd ./plugins/nsmplugin && go generate .
./plugins/crdplugin/scripts/update-codegen.sh ${CRDGEN_DEPS_DIR}
build-images: ## Build all images
make cnf-crd-image
make nsm-agent-vpp-image
make nsm-agent-linux-image
push-images: ## Push images to internal repo
./scripts/push-images.sh $(IMAGE_REPO)
cleanup-images:
./scripts/cleanup-images.sh $(IMAGE_REPO)
get-linter:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2
golangci-lint --version
lint:
ifndef LINTER
make get-linter
endif
./scripts/static-analysis.sh