-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (27 loc) · 1.08 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
.PHONY: all dep test lint build
WORKSPACE ?= $$(pwd)
GO_PKG_LIST := $(shell go list ./... | grep -v /vendor/)
lint:
@golint -set_exit_status ${GO_PKG_LIST}
dep:
@echo "Resolving go package dependencies"
@go mod tidy
@go mod vendor
@echo "Package dependencies completed"
update-sdk:
@echo "Updating SDK dependencies"
@export GOFLAGS="" && go get "github.com/Axway/agent-sdk@main"
${WORKSPACE}/apic_discovery_agent: dep
@export time=`date +%Y%m%d%H%M%S` && \
export version=`cat version` && \
export commit_id=`git rev-parse --short HEAD` && \
go build -tags static_all \
-ldflags="-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildTime=$${time}' \
-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildVersion=$${version}' \
-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildCommitSha=$${commit_id}' \
-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildAgentName=SampleDiscoveryAgent'" \
-a -o ${WORKSPACE}/bin/apigee_discovery_agent ${WORKSPACE}/main.go
build:${WORKSPACE}/apic_discovery_agent
@echo "Build complete"
apigee-generate: ## generate apigee resources
./scripts/apigee_generate.sh