-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
43 lines (29 loc) · 1.07 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
default: packages deploy
deploy: plan terraform
terraform apply -input=false < plan
plan: templates terraform
terraform plan -input=false -out plan
templates: leader-cloud-config.yml follower-cloud-config.yml
leader-cloud-config.yml: discovery_url
cat templates/leader-cloud-config.yml.template | sed -e "s#{{ discovery_url }}#`cat discovery_url`#" > leader-cloud-config.yml
follower-cloud-config.yml: discovery_url
cat templates/follower-cloud-config.yml.template | sed -e "s#{{ discovery_url }}#`cat discovery_url`#" > follower-cloud-config.yml
discovery_url:
curl -s https://discovery.etcd.io/new > discovery_url
destroy: terraform
terraform destroy -input=false
clean:
rm -f plan
rm -f discovery_url
rm -f leader-cloud-config.yml
rm -f follower-cloud-config.yml
clean-all: destroy clean
rm -f terraform.tfstate
rm -f terraform.tfstate.backup
packages: /usr/local/bin/fleetctl /usr/local/bin/terraform
fleetctl: /usr/local/bin/fleetctl
/usr/local/bin/fleetctl:
brew install fleetctl
terraform: /usr/local/bin/terraform
/usr/local/bin/terraform:
brew install terraform