-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
42 lines (38 loc) · 1.45 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
.PHONY: secrets
secrets:
kubectl create namespace ui
kubectl create namespace api
kubectl create namespace database
kubectl create secret generic api -n api --from-env-file api.env
kubectl create secret generic migrations -n api --from-env-file migrations.env
kubectl create secret generic database -n database --from-env-file database.env
.PHONY: demo
demo: secrets
kustomize build flux | kubectl apply -f -
# This regenerates the istio manifests while using yq to remove the CRD for the
# operator so it doesn't clash with the istio operator which also includes the
# CRD. Note: the yq used here is the python (not go) version
.PHONY: update-istio
update-istio:
istioctl manifest generate --dry-run | yq -y 'select(.metadata.name != "istiooperators.install.istio.io" or .kind != "CustomResourceDefinition") | select (.!=null)' > ingress/istio.yaml
# This regenerates the istio operator manifests, which include the IstioOperator
# CRD that we omitted above
.PHONY: update-istio-operator
update-istio-operator:
istioctl operator dump --dry-run > ingress/istio-operator.yaml
.ONESHELL:
.PHONY: credentials
credentials:
@cat <<-'EOF' > migrations.env
DB_URL=postgres://bugbounty:[email protected]:5432/bugbounty?sslmode=disable
EOF
@cat <<-'EOF' > database.env
POSTGRES_USER=bugbounty
POSTGRES_PASSWORD=secret
API_USER=leastprivilegeuser
API_PASSWORD=test
EOF
@cat <<-'EOF' > api.env
DB_USER=leastprivilegeuser
DB_PASS=test
EOF