|
1 | | -# Copyright 2018 Google Inc. All Rights Reserved. |
2 | | -# |
3 | | -# Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | -# you may not use this file except in compliance with the License. |
5 | | -# You may obtain a copy of the License at |
6 | | -# |
7 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
8 | | -# |
9 | | -# Unless required by applicable law or agreed to in writing, software |
10 | | -# distributed under the License is distributed on an "AS IS" BASIS, |
11 | | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | -# See the License for the specific language governing permissions and |
13 | | -# limitations under the License. |
14 | | - |
15 | | -# |
16 | | -# Include for Windows, operating under WSL |
17 | | -# |
18 | | - |
19 | | -# __ __ _ _ _ |
20 | | -# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ |
21 | | -# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| |
22 | | -# \ V / (_| | | | | (_| | |_) | | __\__ \ |
23 | | -# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ |
24 | | -# |
25 | | - |
26 | | -# Minikube executable |
27 | | -MINIKUBE ?= minikube.exe |
28 | | -# Default minikube driver |
29 | | -MINIKUBE_DRIVER ?= hyperv |
30 | | -# set docker env for minikube |
31 | | -MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env --shell=bash) && \ |
32 | | - export DOCKER_CERT_PATH=$$(echo $$DOCKER_CERT_PATH | $(win_to_wsl_path)) |
33 | | - |
34 | | -# minikube shell mount for certificates |
35 | | -minikube_cert_mount = $(cert_path):$(cert_path) |
36 | | - |
37 | | -# transform the path from windows to WSL |
38 | | -win_to_wsl_path := sed -e 's|\([A-Z]\):|/\L\1|' -e 's|\\|/|g' |
39 | | - |
40 | | -# find the cert path |
41 | | -cert_path = $(realpath $(shell $(MINIKUBE) docker-env --shell bash | grep DOCKER_CERT_PATH | awk -F "=" '{ print $$2 }' | sed 's/"//g' | $(win_to_wsl_path))/..) |
42 | | - |
43 | | -# _____ _ |
44 | | -# |_ _|_ _ _ __ __ _ ___| |_ ___ |
45 | | -# | |/ _` | '__/ _` |/ _ \ __/ __| |
46 | | -# | | (_| | | | (_| | __/ |_\__ \ |
47 | | -# |_|\__,_|_| \__, |\___|\__|___/ |
48 | | -# |___/ |
49 | | - |
50 | | -# Sets minikube credentials |
51 | | -minikube-post-start: |
52 | | - echo "Creating minikube credentials" |
53 | | - export CERT_PATH=$(cert_path) && \ |
54 | | - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-cluster $(MINIKUBE_PROFILE) \ |
55 | | - --certificate-authority=$$CERT_PATH/ca.crt --server=https://$$($(MINIKUBE) ip):8443 && \ |
56 | | - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-credentials $(MINIKUBE_PROFILE) \ |
57 | | - --client-certificate=$$CERT_PATH/client.crt --client-key=$$CERT_PATH/client.key |
58 | | - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-context $(MINIKUBE_PROFILE) \ |
59 | | - --cluster=$(MINIKUBE_PROFILE) --user=$(MINIKUBE_PROFILE) |
60 | | - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config use-context $(MINIKUBE_PROFILE) |
| 1 | +# Copyright 2018 Google Inc. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# |
| 16 | +# Include for Windows, operating under WSL |
| 17 | +# |
| 18 | + |
| 19 | +# __ __ _ _ _ |
| 20 | +# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ |
| 21 | +# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| |
| 22 | +# \ V / (_| | | | | (_| | |_) | | __\__ \ |
| 23 | +# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ |
| 24 | +# |
| 25 | + |
| 26 | +# Minikube executable |
| 27 | +MINIKUBE ?= minikube.exe |
| 28 | +# Default minikube driver |
| 29 | +MINIKUBE_DRIVER ?= hyperv |
| 30 | +# set docker env for minikube |
| 31 | +MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env --shell=bash) && \ |
| 32 | + export DOCKER_CERT_PATH=$$(echo $$DOCKER_CERT_PATH | $(win_to_wsl_path)) |
| 33 | + |
| 34 | +# minikube shell mount for certificates |
| 35 | +minikube_cert_mount = $(cert_path):$(cert_path) |
| 36 | + |
| 37 | +# transform the path from windows to WSL |
| 38 | +win_to_wsl_path := sed -e 's|\([A-Z]\):|/\L\1|' -e 's|\\|/|g' |
| 39 | + |
| 40 | +# find the cert path |
| 41 | +cert_path = $(realpath $(shell $(MINIKUBE) docker-env --shell bash | grep DOCKER_CERT_PATH | awk -F "=" '{ print $$2 }' | sed 's/"//g' | $(win_to_wsl_path))/..) |
| 42 | + |
| 43 | +# _____ _ |
| 44 | +# |_ _|_ _ _ __ __ _ ___| |_ ___ |
| 45 | +# | |/ _` | '__/ _` |/ _ \ __/ __| |
| 46 | +# | | (_| | | | (_| | __/ |_\__ \ |
| 47 | +# |_|\__,_|_| \__, |\___|\__|___/ |
| 48 | +# |___/ |
| 49 | + |
| 50 | +# Sets minikube credentials |
| 51 | +minikube-post-start: |
| 52 | + echo "Creating minikube credentials" |
| 53 | + export CERT_PATH=$(cert_path) && \ |
| 54 | + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-cluster $(MINIKUBE_PROFILE) \ |
| 55 | + --certificate-authority=$$CERT_PATH/ca.crt --server=https://$$($(MINIKUBE) ip):8443 && \ |
| 56 | + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-credentials $(MINIKUBE_PROFILE) \ |
| 57 | + --client-certificate=$$CERT_PATH/client.crt --client-key=$$CERT_PATH/client.key |
| 58 | + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-context $(MINIKUBE_PROFILE) \ |
| 59 | + --cluster=$(MINIKUBE_PROFILE) --user=$(MINIKUBE_PROFILE) |
| 60 | + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config use-context $(MINIKUBE_PROFILE) |
0 commit comments