-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (41 loc) · 1.21 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
#Arches can be: amd64 s390x arm64 ppc64le
ARCH ?= ppc64le
REGISTRY ?= quay.io/powercloud
REPOSITORY ?= power-dev-plugin
TAG ?= latest
CONTAINER_RUNTIME ?= $(shell command -v podman 2> /dev/null || echo docker)
########################################################################
# Go Targets
.PHONY: build
build: fmt vet
GOOS=linux GOARCH=$(ARCH) go build -o bin/power-dev-plugin cmd/power-dev-plugin/main.go
GOOS=linux GOARCH=$(ARCH) go build -o bin/power-dev-webhook cmd/webhook/main.go
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: vet
vet:
go vet ./...
.PHONY: clean
clean:
rm -f ./bin/power-dev-plugin
rm -rf vendor
########################################################################
# Container Targets
.PHONY: image
image:
$(CONTAINER_RUNTIME) buildx build \
-t $(REGISTRY)/$(REPOSITORY):$(TAG) \
--platform linux/$(ARCH) -f build/Containerfile .
.PHONY: push
push:
$(info push Container image...)
$(CONTAINER_RUNTIME) push $(REGISTRY)/$(REPOSITORY):$(TAG)
########################################################################
# Deployment Targets
.PHONY: dep-plugin
dep-plugin:
kustomize build manifests | oc apply -f -
.PHONY: dep-examples
dep-examples:
kustomize build examples | oc apply -f -