-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
52 lines (39 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Set the default goal
.DEFAULT_GOAL := build
VERSION := $(shell git describe --tags)
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION)"
# Active module mode, as we use Go modules to manage dependencies
export GO111MODULE=on
GO_FMT=gofmt
.PHONY: build fmt vet test
default : build
.PHONY: build
build :
@echo "Building Postee...."
CGO_ENABLED=0 go build $(LDFLAGS) -o ./postee main.go
@echo "Done!"
fmt :
@echo "fmt...."
$(GO_FMT) -s -w ./
test :
go test -race -v -timeout=30s ./...
test-integration:
go test -race -v -tags=integration -timeout=30s ./...
cover :
go test ./msgservice ./dbservice ./router ./formatting ./data ./regoservice ./routes ./actions -v -coverprofile=cover.out
go tool cover -html=cover.out
composer :
@echo "Running Postee UI...."
docker-compose up --build
docker-webhook : build
@echo "Building image Dockerfile.release...."
docker build --no-cache -t aquasec/postee:latest -f Dockerfile.release .
docker run -p 8082:8082 -p 8445:8445 aquasec/postee:latest --cfgfile /server/cfg.yaml
docker-ui :
@echo "Building image Dockerfile.ui...."
docker build --no-cache -t aquasec/postee-ui:latest -f Dockerfile.ui .
deploy-k8s :
@echo "Deploy Postee in Kubernetes...."
kubectl create -f deploy/kubernetes
kubectl wait --for=condition=available \
--timeout=1m deploy/postee