1
0
Fork 0
mirror of https://github.com/kyverno/policy-reporter.git synced 2024-12-14 11:57:32 +00:00
policy-reporter/Makefile

41 lines
1.2 KiB
Makefile
Raw Normal View History

2021-02-19 23:58:01 +00:00
GO ?= go
BUILD ?= build
REPO ?= ghcr.io/kyverno/policy-reporter
IMAGE_TAG ?= 2.1.0
LD_FLAGS='-s -w -linkmode external -extldflags "-static"'
2021-02-19 23:58:01 +00:00
all: build
.PHONY: clean
clean:
rm -rf $(BUILD)
.PHONY: prepare
prepare:
mkdir -p $(BUILD)
2021-02-24 00:06:58 +00:00
.PHONY: test
test:
go test -v ./... -timeout=10s
2021-02-24 00:06:58 +00:00
.PHONY: coverage
coverage:
go test -v ./... -covermode=count -coverprofile=coverage.out -timeout=30s
2021-02-24 00:06:58 +00:00
2021-02-19 23:58:01 +00:00
.PHONY: build
build: prepare
CGO_ENABLED=1 $(GO) build -v -ldflags="-s -w" $(GOFLAGS) -o $(BUILD)/policyreporter .
2021-06-27 10:11:39 +00:00
.PHONY: docker-build
docker-build:
@docker buildx build --progress plane --platform linux/arm64,linux/amd64,linux/s390x --tag $(REPO):$(IMAGE_TAG) . --build-arg LD_FLAGS=$(LD_FLAGS)
2021-06-27 10:11:39 +00:00
.PHONY: docker-push
docker-push:
@docker buildx build --progress plane --platform linux/arm64,linux/amd64,linux/s390x --tag $(REPO):$(IMAGE_TAG) . --build-arg LD_FLAGS=$(LD_FLAGS) --push
@docker buildx build --progress plane --platform linux/arm64,linux/amd64,linux/s390x --tag $(REPO):latest . --build-arg LD_FLAGS=$(LD_FLAGS) --push
.PHONY: docker-push-dev
docker-push-dev:
@docker buildx build --progress plane --platform linux/arm64,linux/amd64,linux/s390x --tag $(REPO):dev . --build-arg LD_FLAGS=$(LD_FLAGS) --push