-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
58 lines (45 loc) · 1.42 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
PKG = $(shell cat go.mod | grep "^module " | sed -e "s/module //g")
VERSION = $(shell cat internal/version/version)
COMMIT_SHA ?= $(shell git rev-parse --short HEAD)
TAG ?= $(VERSION)
GOBIN ?= ./bin
PUSH ?= true
NAMESPACES ?= docker.io/octohelm
TARGETS ?= qservice-operator
DOCKER_BUILDX_BUILD = docker buildx build \
--label=org.opencontainers.image.source=https://github.com/$(REPO) \
--label=org.opencontainers.image.revision=$(COMMIT_SHA) \
--platform=linux/arm64,linux/amd64
ifeq ($(PUSH),true)
DOCKER_BUILDX_BUILD := $(DOCKER_BUILDX_BUILD) --push
endif
up:
KUBECONFIG=~/.kube/config--hw-sg.yaml \
INGRESS_GATEWAYS=auto-internal:hw-sg.rktl.xyz \
WATCH_NAMESPACE=default \
go run ./cmd/qservice-operator/main.go
fmt:
goimports -l -w .
build:
goreleaser build --snapshot --rm-dist
lint:
husky hook pre-commit
husky hook commit-msg
eval:
cuem eval -w --output=./bin/qservice-operator.cue ./deploy/component
apply.example:
cuem k apply ./deploy/qservice-opreator.cue
apply.demo:
cuem k apply ./deploy/qservice.cue
gen-deepcopy:
deepcopy-gen \
--output-file-base zz_generated.deepcopy \
--go-header-file ./boilerplate.go.txt \
--input-dirs $(PKG)/pkg/apis/serving/v1alpha1,$(PKG)/pkg/strfmt
dockerx: build
$(foreach target,$(TARGETS),\
$(DOCKER_BUILDX_BUILD) \
--build-arg=VERSION=$(VERSION) \
$(foreach namespace,$(NAMESPACES),--tag=$(namespace)/$(target):$(TAG)) \
--file=cmd/$(target)/Dockerfile . ;\
)