This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
70 lines (54 loc) · 1.9 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
KUBEPATH = $(GOPATH)/src/k8s.io/kubernetes
KUBERNETES_BUILD_CONTAINER = docker ps --filter=name=kubernetes-build -q
.PHONY: all
all: up instructions kubeconfig
.PHONY: base-box
base-box:
$(MAKE) -C $@
.PHONY: up
up: base-box
vagrant up
.PHONY: kubeconfig
kubeconfig:
@scripts/fetch-kubeconfig.sh
.PHONY: instructions
instructions:
@ruby -I vagrant -r utils -e 'cluster.instructions' 2> /dev/null
.PHONY: reset
reset:
@ruby -I vagrant -r utils -e 'print cluster.cluster_machines.map(&:full_name).join("\n")' | xargs -I{} vagrant ssh {} -c "sudo kubeadm reset -f"
@rm -rf ~/.kube
.PHONY: run
run:
$(MAKE) -C kubernetes-build
-@kubernetes-build/scripts/start-container.sh &> /dev/null
.PHONY: debs
debs: run
docker exec -it $(shell $(KUBERNETES_BUILD_CONTAINER)) su -c "cd $(KUBEPATH) && bazel build //build/debs" - $(shell id -u -n)
.PHONY: images
images: run
docker exec -it $(shell $(KUBERNETES_BUILD_CONTAINER)) su -c "cd $(KUBEPATH) && bazel build //build:docker-artifacts" - $(shell id -u -n)
.PHONY: artifacts
artifacts: debs images
.PHONY: shell
shell: run
docker exec -it $(shell $(KUBERNETES_BUILD_CONTAINER)) su -c "cd $(KUBEPATH) && bash" - $(shell id -u -n)
.PHONY: bazel
bazel: run
docker exec -it $(shell $(KUBERNETES_BUILD_CONTAINER)) su -c "cd $(KUBEPATH) && bazel $(WHAT)" - $(shell id -u -n)
.PHONY: kubeadm-e2e
kubeadm-e2e:
$(MAKE) bazel WHAT="build //vendor/github.com/onsi/ginkgo/ginkgo //test/e2e_kubeadm:e2e_kubeadm.test"
KUBECONFIG=$(HOME)/.kube/config $(KUBEPATH)/bazel-bin/test/e2e_kubeadm/e2e_kubeadm.test
.PHONY: destroy
destroy:
@vagrant destroy -f &> /dev/null || true
@ruby -I vagrant -r utils -e 'print cluster.name' 2> /dev/null | xargs -I{} rm -rf tmp/{} || true
@rm -rf ~/.kube &> /dev/null || true
.PHONY: clean
clean: destroy
@docker rm -f -v kubernetes-build &> /dev/null || true
.PHONY: full-clean
full-clean: clean
$(MAKE) -C base-box clean
$(MAKE) -C kubernetes-build clean