This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
62 lines (46 loc) · 1.55 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
DOCKER_REPO ?= docker.io/
IMAGE ?= $(USER)/tomcat-operator
TAG ?= v0.0.3
PROG := tomcat-operator
.DEFAULT_GOAL := help
## setup Ensure the operator-sdk is installed.
setup:
./build/setup-operator-sdk.sh
## tidy Ensure modules are tidy.
tidy:
go mod tidy
## codegen Ensure code is generated.
codegen: setup
operator-sdk generate k8s
operator-sdk generate openapi
## build Compile and build the Tomcat operator.
build: tidy unit-test
./build/build.sh ${GOOS}
## image Create the Docker image of the operator
image: build
docker build -t "$(DOCKER_REPO)$(IMAGE):$(TAG)" . -f build/Dockerfile
## push Push Docker image to the docker.io repository.
push: image
docker push "$(DOCKER_REPO)$(IMAGE):$(TAG)"
## clean Remove all generated build files.
clean:
rm -rf build/_output
rm deploy/operator.yaml
deploy/operator.yaml: deploy/operator.template
sed 's|@OP_IMAGE_TAG@|$(DOCKER_REPO)$(IMAGE):$(TAG)|' deploy/operator.template > deploy/operator.yaml
## run-openshift Run the Tomcat operator on OpenShift.
run-openshift: deploy/operator.yaml
./build/run-openshift.sh
## run-kubernetes Run the Tomcat operator on kubernetes.
run-kubernetes: deploy/operator.yaml
./build/run-kubernetes.sh
## test Perform all tests.
test: unit-test scorecard test-e2e
## scorecard Run operator-sdk scorecard.
scorecard: setup
operator-sdk scorecard --verbose
## unit-test Perform unit tests.
unit-test:
go test -v ./... -tags=unit
help : Makefile
@sed -n 's/^##//p' $<