-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.2 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
SHELL := /bin/bash
.PHONY: all
all: bin init
.PHONY: docker
docker: Dockerfile
docker build -t consulenvoy .
.PHONY: tls
tls: cache/tls.done
cache/tls.done:
# TODO(rb): take a node name arg and do this for the user
@mkdir -p cache
@cd cache ; consul tls ca create
@cd cache ; consul tls cert create -dc=dc1 -server -additional-dnsname='dc1-server1-node.server.dc1.consul'
@cd cache ; consul tls cert create -dc=dc2 -server -additional-dnsname='dc2-server1-node.server.dc2.consul'
@cd cache ; consul tls cert create -dc=dc1 -client
@cd cache ; consul tls cert create -dc=dc2 -client
@touch cache/tls.done
# wangossip-stream.dc1-server1-node.server.dc1.consul
.PHONY: up-pri
up-pri: tls docker
docker-compose up -d dc1-server1-node dc1-server1 dc1-client1-node dc1-client1 dc1-mesh-gateway1
.PHONY: up-sec
up-sec: tls docker
docker-compose up -d dc2-server1-node dc2-server1 dc2-client1-node dc2-client1 dc2-mesh-gateway1
.PHONY: up
up: tls docker
docker-compose up -d
.PHONY: down
down:
docker-compose down -v --remove-orphans
.PHONY: restart
restart:
docker-compose down
docker-compose up -d
.PHONY: members
members:
@./consul.sh dc1 members
.PHONY: services
services:
@./consul.sh dc1 catalog services