forked from danielfm/aws-limits-exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (29 loc) · 935 Bytes
/
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
.PHONY: test
export GOBIN := $(PWD)/bin
export PATH := $(GOBIN):$(PATH)
export INSTALL_FLAG=
export TAG=0.4.5
DOCKER_IMAGE = aws-limits-exporter
DOCKER_REPO = gcr.io/pingcap-public
# Determine which OS.
OS?=$(shell uname -s | tr A-Z a-z)
default: build
dependencies:
@go mod tidy -v
dep: dependencies
run-server: build
$(GOBIN)/aws-limits-exporter
test:
@go test ./... -timeout 2m -v -race
test-cover:
@go test ./... -timeout 2m -race -cover
build:
CGO_ENABLED=0 GOOS=$(OS) go build -mod vendor $(INSTALL_FLAG) -a --ldflags "-X main.VERSION=$(TAG) -w -extldflags '-static'" -tags netgo -o $(GOBIN)/aws-limits-exporter ./cmd
clean:
@go clean
docker-build:
docker build -t ${DOCKER_REPO}/$(DOCKER_IMAGE):latest .
docker-deploy:
docker tag ${DOCKER_REPO}/$(DOCKER_IMAGE):latest ${DOCKER_REPO}/$(DOCKER_IMAGE):$(TAG)
docker push ${DOCKER_REPO}/$(DOCKER_IMAGE):$(TAG)
docker push ${DOCKER_REPO}/$(DOCKER_IMAGE):latest