forked from gravitational/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (75 loc) · 2.31 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# location of the test enterprise license file
ENTERPRISE_LICENSE ?= ../e/fixtures/license-enterprise.pem
# location of the test pro license file
PRO_LICENSE ?= ../e/fixtures/license-pro.pem
# whether to look for enterprise or pro license
MODE ?= enterprise
#
# Default target starts two Teleport clusters
#
.PHONY: up
up: check-license
docker-compose up
.PHONY: reup
reup: check-license
cd .. && make
docker-compose up
# 'make down' stops all Teleport containers, deletes them
# and their network
#
.PHONY:down
down:
docker-compose down
# `make enter-one` gives you shell inside auth server
# of cluster "one"
#
.PHONY:enter-one
enter-one:
docker exec -ti one /bin/bash
# `make enter-two` gives you shell inside auth server
# of cluster "two"
#
.PHONY:enter-two
enter-two:
docker exec -ti two-auth /bin/bash
# `make enter-sshd` gives you shell inside sshd container
.PHONY:enter-sshd
enter-sshd:
docker exec -ti one-sshd /bin/bash
# `make enter-two-proxy` gives you shell inside proxy server
# of cluster "two"
#
.PHONY:enter-two-proxy
enter-two-proxy:
docker exec -ti two-proxy /bin/bash
# `make enter-two-node` gives you shell inside a node
# of cluster "two"
#
.PHONY:enter-two-node
enter-two-node:
docker exec -ti two-node /bin/bash
.PHONY: export-certs
export-certs:
docker exec -i one /bin/bash -c "tctl auth export --type=user | sed s/cert-authority\ // > /mnt/shared/certs/teleport.pub"
.PHONY: setup-tc
setup-tc:
docker exec -i two-auth /bin/bash -c "tctl -c /root/go/src/github.com/gravitational/teleport/docker/two-auth.yaml create -f /root/go/src/github.com/gravitational/teleport/docker/two-tc.yaml"
.PHONY: delete-tc
delete-tc:
docker exec -i two-auth /bin/bash -c "tctl -c /root/go/src/github.com/gravitational/teleport/docker/two-auth.yaml rm tc/one"
.PHONY: check-license
check-license:
@if [ $(MODE) = "enterprise" ] && [ -f $(ENTERPRISE_LICENSE) ]; then \
mkdir -p ./data/one && cp $(ENTERPRISE_LICENSE) ./data/one/license.pem; \
mkdir -p ./data/two/auth && cp $(ENTERPRISE_LICENSE) ./data/two/auth/license.pem; \
fi
@if [ $(MODE) = "pro" ] && [ -f $(PRO_LICENSE) ]; then \
mkdir -p ./data/one && cp $(PRO_LICENSE) ./data/one/license.pem; \
mkdir -p ./data/two/auth && cp $(PRO_LICENSE) ./data/two/auth/license.pem; \
fi
.PHONY: build
build:
docker build -t teleport:latest .
.PHONY: clean
clean:
rm -rf data