forked from aquasecurity/starboard-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (26 loc) · 927 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
# Set the default goal
.DEFAULT_GOAL := build
# Active module mode, as we use Go modules to manage dependencies
export GO111MODULE=on
# Disable CGO
export CGO_ENABLED=0
SOURCES := $(shell find . -name '*.go')
IMAGE_TAG := dev
OPERATOR_IMAGE := aquasec/starboard-security-operator:$(IMAGE_TAG)
SCANNER_IMAGE := aquasec/starboard-scanner-aqua:$(IMAGE_TAG)
.PHONY: modules
modules:
go mod tidy
build: operator scanner
scanner: $(SOURCES)
go build -o bin/scanner cmd/scanner/main.go
operator: $(SOURCES)
go build -o bin/operator cmd/operator/main.go
.PHONY: test
test:
CGO_ENABLED=1 go test -v -short -race -coverprofile=coverage.txt -covermode=atomic ./...
docker-build: docker-build-operator docker-build-scanner
docker-build-operator: build
docker build --no-cache -t $(OPERATOR_IMAGE) -f Dockerfile.operator bin
docker-build-scanner: build
docker build --no-cache -t $(SCANNER_IMAGE) -f Dockerfile.scanner bin