...
1# Copyright 2018 Datawire. All rights reserved.
2#
3# Makefile snippet for calling `telepresence`
4#
5## Eager inputs ##
6# - Variable: KUBECONFIG
7## Outputs ##
8# - .PHONY Target: proxy
9# - .PHONY Target: unproxy
10# - .PHONY Target: status-proxy
11## common.mk targets ##
12# - clean
13ifeq ($(words $(filter $(abspath $(lastword $(MAKEFILE_LIST))),$(abspath $(MAKEFILE_LIST)))),1)
14_teleproxy.mk := $(lastword $(MAKEFILE_LIST))
15include $(dir $(_teleproxy.mk))prelude.mk
16
17proxy: ## (Telepresence) Launch telepresence in the background
18proxy: $(KUBECONFIG) $(tools/telepresence)
19 $(tools/telepresence) connect
20.PHONY: proxy
21
22unproxy: ## (Telepresence) Shut down 'proxy'
23 $(tools/telepresence) quit || true
24.PHONY: unproxy
25
26status-proxy: ## (Telepresence) Fail if cluster connectivity is broken or telepresence is not running
27status-proxy: status-cluster
28 $(tools/telepresence) status
29.PHONY: status-proxy
30
31$(KUBECONFIG).clean: unproxy
32
33clean-proxy: unproxy
34
35endif
View as plain text