forked from redhat-developer/service-binding-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommons.mk
207 lines (167 loc) · 6.57 KB
/
commons.mk
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash
#-----------------------------------------------------------------------------
# VERBOSE target
#-----------------------------------------------------------------------------
# When you run make VERBOSE=1 (the default), executed commands will be printed
# before executed. If you run make VERBOSE=2 verbose flags are turned on and
# quiet flags are turned off for various commands. Use V_FLAG in places where
# you can toggle on/off verbosity using -v. Use Q_FLAG in places where you can
# toggle on/off quiet mode using -q. Use S_FLAG where you want to toggle on/off
# silence mode using -s...
VERBOSE ?= 1
Q = @
Q_FLAG = -q
QUIET_FLAG = --quiet
V_FLAG =
VERBOSE_FLAG =
S_FLAG = -s
X_FLAG =
ifeq ($(VERBOSE),1)
Q =
endif
ifeq ($(VERBOSE),2)
Q =
Q_FLAG =
QUIET_FLAG =
S_FLAG =
V_FLAG = -v
VERBOSE_FLAG = --verbose
X_FLAG = -x
endif
#-----------------------------------------------------------------------------
# Examples Commons
#-----------------------------------------------------------------------------
EC=$(SHELL) -c '. ../../hack/examples-commons.sh && $$1' EC
export HACK_YAMLS=../../hack/yamls
## -- Commmon Utility targets --
## Print help message for all Makefile targets
## Run `make` or `make help` to see the help
.PHONY: help
help: ## Credit: https://gist.github.com/prwhite/8168133#gistcomment-2749866
@printf "Usage:\n make <target>";
@awk '{ \
if ($$0 ~ /^.PHONY: [a-zA-Z\-\_0-9]+$$/) { \
helpCommand = substr($$0, index($$0, ":") + 2); \
if (helpMessage) { \
printf "\033[36m%-20s\033[0m %s\n", \
helpCommand, helpMessage; \
helpMessage = ""; \
} \
} else if ($$0 ~ /^[a-zA-Z\-\_0-9.]+:/) { \
helpCommand = substr($$0, 0, index($$0, ":")); \
if (helpMessage) { \
printf "\033[36m%-20s\033[0m %s\n", \
helpCommand, helpMessage; \
helpMessage = ""; \
} \
} else if ($$0 ~ /^##/) { \
if (helpMessage) { \
helpMessage = helpMessage"\n "substr($$0, 3); \
} else { \
helpMessage = substr($$0, 3); \
} \
} else { \
if (helpMessage) { \
print "\n "helpMessage"\n" \
} \
helpMessage = ""; \
} \
}' \
$(MAKEFILE_LIST)
## -- Common Cluster Admin Targets --
## --- Service Binding Operator ---
.PHONY: install-service-binding-operator-subscription
## Install the Service Binding Operator Subscription
install-service-binding-operator-subscription:
${Q}${EC} install_service_binding_operator_subscription
.PHONY: install-service-binding-operator
## Install the Service Binding Operator
install-service-binding-operator: install-service-binding-operator-subscription
.PHONY: uninstall-service-binding-operator-subscription
## Uninstall the Service Binding Operator Subscription
uninstall-service-binding-operator-subscription:
${Q}${EC} uninstall_service_binding_operator_subscription
.PHONY: uninstall-service-binding-operator
## Uninstall the Service Binding Operator
uninstall-service-binding-operator: uninstall-service-binding-operator-subscription
## --- Backing Service DB (PostgreSQL) Operator ---
.PHONY: install-backing-db-operator-source
## Install the Backing Service DB Operator Source
install-backing-db-operator-source:
${Q}${EC} install_postgresql_operator_source
.PHONY: install-backing-db-operator-subscription
## Install the Backing Service DB Operator Subscription
install-backing-db-operator-subscription:
${Q}${EC} install_postgresql_operator_subscription
.PHONY: install-backing-db-operator
## Install the Backing Service DB Operator
install-backing-db-operator: install-backing-db-operator-source install-backing-db-operator-subscription
.PHONY: uninstall-backing-db-operator-source
## Uninstall the Backing Service DB Operator Source
uninstall-backing-db-operator-source:
${Q}${EC} uninstall_postgresql_operator_source
.PHONY: uninstall-backing-db-operator-subscription
## Uninstall the Backing Service DB Operator Subscription
uninstall-backing-db-operator-subscription:
${Q}${EC} uninstall_postgresql_operator_subscription
.PHONY: uninstall-backing-db-operator
## Uninstall the Backing Service DB Operator
uninstall-backing-db-operator: uninstall-backing-db-operator-subscription uninstall-backing-db-operator-source
## --- Serverless Operator ---
.PHONY: install-serverless-operator-subscription
## Install the Serverless Operator Subscription
install-serverless-operator-subscription:
${Q}${EC} install_serverless_operator_subscription
.PHONY: install-serverless-operator
## Install the Serverless Operator
install-serverless-operator: install-serverless-operator-subscription
.PHONY: uninstall-serverless-operator-subscription
## Uninstall the Serverless Operator Subscription
uninstall-serverless-operator-subscription:
${Q}${EC} uninstall_serverless_operator_subscription
.PHONY: uninstall-serverless-operator
## Uninstall the Serverless Operator
uninstall-serverless-operator: uninstall-serverless-operator-subscription
## --- Service Mesh Operator ---
.PHONY: install-service-mesh-operator-subscription
## Install the Service Mesh Operator Subscription
install-service-mesh-operator-subscription:
${Q}${EC} install_service_mesh_operator_subscription
.PHONY: install-service-mesh-operator
## Install the Service Mesh Operator
install-service-mesh-operator: install-service-mesh-operator-subscription
.PHONY: uninstall-service-mesh-operator-subscription
## Uninstall the Service Mesh Operator Subscription
uninstall-service-mesh-operator-subscription:
${Q}${EC} uninstall_service_mesh_operator_subscription
.PHONY: uninstall-service-mesh-operator
## Uninstall the Service Mesh Operator
uninstall-service-mesh-operator: uninstall-service-mesh-operator-subscription
## --- Knative Serving (Serverless UI)
.PHONY: install-knative-serving
## Install Knative Serving
install-knative-serving:
${Q}${EC} install_knative_serving
.PHONY: uninstall-knative-serving
## Uninstall Knative Serving
uninstall-knative-serving:
${Q}-${EC} uninstall_knative_serving
# === Quarkus Native S2i Buider Image ===
.PHONY: install-quarkus-native-s2i-builder
## Install ubi-quarkus-native-s2i builder
install-quarkus-native-s2i-builder:
${Q}${EC} install_ubi_quarkus_native_s2i_builder_image
## -- Common Application Developer Targets --
.PHONY: create-project
## Create the OpenShift project/namespace
create-project:
${Q}-${EC} create_project
.PHONY: delete-project
## Delete the OpenShift project/namespace
delete-project:
${Q}${EC} delete_project
.PHONY: create-backing-db-instance
## Create the Backing Service DB Operator
create-backing-db-instance:
${Q}${EC} install_postgresql_db_instance