This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
66 lines (53 loc) · 1.7 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
include examples.mk
include testing-env.mk
HELM_DOCS_IMAGE = jnorwood/helm-docs:v1.8.1
.PHONY: gen-api
gen-api:
./hack/update-codegen.sh
git add pkg/apis pkg/client
CONTROLLER_GEN := $(GOPATH)/bin/controller-gen
$(CONTROLLER_GEN):
pushd /tmp; $(GO) get -u sigs.k8s.io/controller-tools/cmd/[email protected]; popd
crd-manifests: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) crd:maxDescLen=0 paths="./pkg/apis/riotkit.org/v1alpha1/..." output:crd:artifacts:config=crds
cp crds/* helm/volume-syncing-controller/templates/
git add crds helm/volume-syncing-controller/templates/
.PHONY: build-all
build-all: gen-api build-binary crd-manifests
.PHONY: build
build: build-binary
.PHONY: build-binary
build-binary:
@echo "\n🔧 Building Go binaries..."
mkdir -p .build
CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o .build/volume-syncing-controller .
.PHONY: build-docker
build-docker:
docker build . -t volume-syncer
.PHONY: helm
helm:
cp README.md helm/volume-syncing-controller/
cd helm/volume-syncing-controller/ && helm lint ./
.PHONY: helm-docs
helm-docs:
docker run --rm --name helm-docs \
--user $(shell id -u):$(shell id -g) \
--mount type=bind,src="$(shell pwd)/helm",dst=/helm-charts \
-w /helm-charts \
$(HELM_DOCS_IMAGE) \
helm-docs
.PHONY: coverage
coverage:
go test -v ./... -covermode=count -coverprofile=coverage.out
.PHONY: minio
minio:
docker rm -f minio1 || true
docker run \
-d \
-p 9000:9000 \
-p 9001:9001 \
--name minio1 \
-v /tmp/minio/data:/data \
-e "MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE" \
-e "MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
quay.io/minio/minio server /data --console-address ":9001"