-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (27 loc) · 1.3 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
NAMESPACE ?= logicmonitor
REPOSITORY ?= collector
VERSION ?= $(shell git describe --tags --always --dirty)
default: build
gofmt:
ifeq ($(shell uname -s), Darwin)
find pkg/ -type f | grep go | egrep -v "mocks|gomock" | xargs gofmt -l -d -s -w; sync
find pkg/ -type f | grep go | egrep -v "mocks|gomock" | xargs gofumpt -l -d -w; sync
find pkg/ -type f | grep go | egrep -v "mocks|gomock" | xargs gci write; sync
find pkg/ -type f | grep go | egrep -v "mocks|gomock" | xargs goimports -l -d -w; sync
find cmd/ -type f | grep go | egrep -v "mocks|gomock" | xargs gofmt -l -d -s -w; sync
find cmd/ -type f | grep go | egrep -v "mocks|gomock" | xargs gofumpt -l -d -w; sync
find cmd/ -type f | grep go | egrep -v "mocks|gomock" | xargs gci write; sync
find cmd/ -type f | grep go | egrep -v "mocks|gomock" | xargs goimports -l -d -w; sync
gofmt -l -d -s -w main.go; sync
gofumpt -l -d -w main.go; sync
gci write main.go; sync
goimports -l -d -w main.go; sync
endif
build:
docker build -t $(NAMESPACE)/$(REPOSITORY):$(VERSION) .
local-build:
docker build -t $(NAMESPACE)/$(REPOSITORY):$(VERSION) -f Dockerfile.gobuild .
gononroot-build:
docker build -t $(NAMESPACE)/$(REPOSITORY):$(VERSION) -f Dockerfile.gononroot .
nonroot-build:
docker build -t $(NAMESPACE)/$(REPOSITORY):$(VERSION) -f Dockerfile.nonroot .