-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (39 loc) · 885 Bytes
/
Makefile
File metadata and controls
43 lines (39 loc) · 885 Bytes
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
.PHONY: test
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
SERVICE_NAME=nightfall_code_scanner
BINARY_NAME=./$(SERVICE_NAME)
GO_TEST_ENV?=test
NAME=nightfallai/$(SERVICE_NAME)
TAG=$(shell git log -1 --pretty=format:"%H")
VERSION=$(NAME):$(TAG)
LATEST=$(NAME):latest
all: clean build start
build:
$(GOBUILD) -o $(BINARY_NAME) -v ./cmd/nightfalldlp/main.go
test:
GO_ENV=$(GO_TEST_ENV) $(GOTEST) ./... -count=1 -coverprofile=coverage.out
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
start:
$(BINARY_NAME)
dockertag:
docker tag $(NAME):latest $(VERSION)
docker tag $(NAME):latest $(LATEST)
dockerbuild:
docker build -t $(VERSION) -t $(LATEST) .
dockerpush:
docker push $(VERSION)
docker push $(LATEST)
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)
deps:
go mod download
generate:
go generate ./...