-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (56 loc) · 1.32 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
63
64
65
66
67
68
69
70
71
default: matchbox.apply
secret=packet-secret.json
module_project=packet_project.project
.PHONY: project.apply
project.apply: $(secret) init
terraform \
apply \
-var-file=$< \
-target=$(module_project)
.PHONY: project.destroy
project.destroy: $(secret)
terraform \
destroy \
-var-file=$< \
-target=$(module_project)
module_elastic_ip=module.matchbox.packet_reserved_ip_block.matchbox
.PHONY: elastic_ip.apply
elastic_ip.apply: $(secret)
terraform \
apply \
-var-file=$< \
-target=$(module_elastic_ip)
.PHONY: elastic_ip.destroy
elastic_ip.destroy: $(secret)
terraform \
destroy \
-var-file=$< \
-target=$(module_elastic_ip)
matchbox_certs_dir=.matchbox
.PHONY: certificates.apply
certificates.apply: elastic_ip.apply
certificates.apply: export SAN=DNS.1:matchbox.example.com,IP.1:$(shell terraform output -module matchbox access_public_ipv4)
certificates.apply:
./scripts/cert-gen.sh
.PHONY: certificates.destroy
certificates.destroy:
rm -rf $(matchbox_certs_dir)/*
matchbox=module.matchbox
.PHONY: matchbox.apply
matchbox.apply: $(secret) certificates.apply
terraform \
apply \
-var-file=$< \
-target=$(matchbox)
.PHONY: matchbox.destroy
matchbox.destroy: $(secret)
terraform \
destroy \
-var-file=$< \
-target=$(matchbox)
.PHONY: init
init:
terraform init
.PHONY: format
format:
terraform fmt