-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (40 loc) · 1.55 KB
/
Makefile
File metadata and controls
55 lines (40 loc) · 1.55 KB
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
# __ __
# __ ______ ____ ___ ____ _/ /____ ____ ____/ /
# / / / / __ \/ __ `__ \/ __ `/ __/ _ \/ __ \/ __ /
# / /_/ / /_/ / / / / / / /_/ / /_/ __/ /_/ / /_/ /
# \__, /\____/_/ /_/ /_/\__,_/\__/\___/\____/\__,_/
# /____ matthewdavis.io, holla!
#
include .make/Makefile.inc
NS ?= default
APP ?= wp-workflow-host
HOST ?= matthewdavis.io
SERVICE_NAME ?= $(APP)
SERVICE_PORT ?= 80
MYSQL_HOST ?=
MYSQL_DATABASE ?=
MYSQL_USER ?=
MYSQL_PASSWORD ?=
GCE_ZONE ?= us-central1-a
GCE_DISK ?= $(APP)
## Create disk
create-disk:
gcloud compute disks create $(GCE_DISK) --zone $(GCE_ZONE) --size 10
install: guard-APP
delete: guard-APP
## Create mysql database & grant (DROP DATABASE is performed!)
initdb:
@nslookup $(MYSQL_HOST)
mysql -h $(MYSQL_HOST) -uroot -pmysql -e "CREATE DATABASE IF NOT EXISTS \`$(MYSQL_DATABASE)\`"
mysql -h $(MYSQL_HOST) -uroot -pmysql -e "GRANT ALL PRIVILEGES ON \`$(MYSQL_DATABASE)\`.* TO '$(MYSQL_USER)'@'10.%' IDENTIFIED BY '$(MYSQL_PASSWORD)'"
dropdb:
@nslookup $(MYSQL_HOST)
@mysql -h $(MYSQL_HOST) -uroot -pmysql -e "DROP DATABASE IF EXISTS \`$(MYSQL_DATABASE)\`" | true
## Create Ingress Resource
ingress-issue:
cd k8-byexamples-ingress-controller && git submodule update --init
$(MAKE) -C k8-byexamples-ingress-controller ingress-issue
## Create LetsEncrypt Certificate Request
certificate-issue:
cd k8-byexamples-ingress-controller && git submodule update --init
$(MAKE) -C k8-byexamples-ingress-controller certificate-issue