diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..75d882e8ae --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +* text=auto diff --git a/.gitignore b/.gitignore index b262acc1ed..ec0c06773d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,9 +14,10 @@ .* !.gitignore +!.gitattributes *.iml bin *.o tmp build/local-includes/* -!build/local-includes/README.md \ No newline at end of file +!build/local-includes/README.md diff --git a/build/includes/linux.mk b/build/includes/linux.mk index 0b9fd1b7f2..9ee4f8e55e 100644 --- a/build/includes/linux.mk +++ b/build/includes/linux.mk @@ -1,44 +1,44 @@ -# Copyright 2018 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Include for Linux operating System -# - -# __ __ _ _ _ -# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ -# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| -# \ V / (_| | | | | (_| | |_) | | __\__ \ -# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ -# - -# Minikube executable -MINIKUBE ?= minikube -# Default minikube driver -MINIKUBE_DRIVER ?= virtualbox -# set docker env for minikube -MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env) - -# minikube shell mount for certificates -minikube_cert_mount := ~/.minikube:$(HOME)/.minikube - -# _____ _ -# |_ _|_ _ _ __ __ _ ___| |_ ___ -# | |/ _` | '__/ _` |/ _ \ __/ __| -# | | (_| | | | (_| | __/ |_\__ \ -# |_|\__,_|_| \__, |\___|\__|___/ -# |___/ - -# Does not do anything -minikube-post-start: \ No newline at end of file +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Include for Linux operating System +# + +# __ __ _ _ _ +# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ +# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| +# \ V / (_| | | | | (_| | |_) | | __\__ \ +# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ +# + +# Minikube executable +MINIKUBE ?= minikube +# Default minikube driver +MINIKUBE_DRIVER ?= virtualbox +# set docker env for minikube +MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env) + +# minikube shell mount for certificates +minikube_cert_mount := ~/.minikube:$(HOME)/.minikube + +# _____ _ +# |_ _|_ _ _ __ __ _ ___| |_ ___ +# | |/ _` | '__/ _` |/ _ \ __/ __| +# | | (_| | | | (_| | __/ |_\__ \ +# |_|\__,_|_| \__, |\___|\__|___/ +# |___/ + +# Does not do anything +minikube-post-start: diff --git a/build/includes/osx.mk b/build/includes/osx.mk index 7d30fd8cb7..774ec78355 100644 --- a/build/includes/osx.mk +++ b/build/includes/osx.mk @@ -1,44 +1,44 @@ -# Copyright 2018 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Include for OSX operating System -# - -# __ __ _ _ _ -# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ -# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| -# \ V / (_| | | | | (_| | |_) | | __\__ \ -# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ -# - -# Minikube executable -MINIKUBE ?= minikube -# Default minikube driver -MINIKUBE_DRIVER ?= virtualbox -# set docker env for minikube -MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env) - -# minikube shell mount for certificates -minikube_cert_mount := ~/.minikube:$(HOME)/.minikube - -# _____ _ -# |_ _|_ _ _ __ __ _ ___| |_ ___ -# | |/ _` | '__/ _` |/ _ \ __/ __| -# | | (_| | | | (_| | __/ |_\__ \ -# |_|\__,_|_| \__, |\___|\__|___/ -# |___/ - -# Does nothing -minikube-post-start: \ No newline at end of file +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Include for OSX operating System +# + +# __ __ _ _ _ +# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ +# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| +# \ V / (_| | | | | (_| | |_) | | __\__ \ +# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ +# + +# Minikube executable +MINIKUBE ?= minikube +# Default minikube driver +MINIKUBE_DRIVER ?= virtualbox +# set docker env for minikube +MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env) + +# minikube shell mount for certificates +minikube_cert_mount := ~/.minikube:$(HOME)/.minikube + +# _____ _ +# |_ _|_ _ _ __ __ _ ___| |_ ___ +# | |/ _` | '__/ _` |/ _ \ __/ __| +# | | (_| | | | (_| | __/ |_\__ \ +# |_|\__,_|_| \__, |\___|\__|___/ +# |___/ + +# Does nothing +minikube-post-start: diff --git a/build/includes/windows.mk b/build/includes/windows.mk index 37b5804b60..cb29fbc096 100644 --- a/build/includes/windows.mk +++ b/build/includes/windows.mk @@ -1,60 +1,60 @@ -# Copyright 2018 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Include for Windows, operating under WSL -# - -# __ __ _ _ _ -# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ -# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| -# \ V / (_| | | | | (_| | |_) | | __\__ \ -# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ -# - -# Minikube executable -MINIKUBE ?= minikube.exe -# Default minikube driver -MINIKUBE_DRIVER ?= hyperv -# set docker env for minikube -MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env --shell=bash) && \ - export DOCKER_CERT_PATH=$$(echo $$DOCKER_CERT_PATH | $(win_to_wsl_path)) - -# minikube shell mount for certificates -minikube_cert_mount = $(cert_path):$(cert_path) - -# transform the path from windows to WSL -win_to_wsl_path := sed -e 's|\([A-Z]\):|/\L\1|' -e 's|\\|/|g' - -# find the cert path -cert_path = $(realpath $(shell $(MINIKUBE) docker-env --shell bash | grep DOCKER_CERT_PATH | awk -F "=" '{ print $$2 }' | sed 's/"//g' | $(win_to_wsl_path))/..) - -# _____ _ -# |_ _|_ _ _ __ __ _ ___| |_ ___ -# | |/ _` | '__/ _` |/ _ \ __/ __| -# | | (_| | | | (_| | __/ |_\__ \ -# |_|\__,_|_| \__, |\___|\__|___/ -# |___/ - -# Sets minikube credentials -minikube-post-start: - echo "Creating minikube credentials" - export CERT_PATH=$(cert_path) && \ - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-cluster $(MINIKUBE_PROFILE) \ - --certificate-authority=$$CERT_PATH/ca.crt --server=https://$$($(MINIKUBE) ip):8443 && \ - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-credentials $(MINIKUBE_PROFILE) \ - --client-certificate=$$CERT_PATH/client.crt --client-key=$$CERT_PATH/client.key - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-context $(MINIKUBE_PROFILE) \ - --cluster=$(MINIKUBE_PROFILE) --user=$(MINIKUBE_PROFILE) - docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config use-context $(MINIKUBE_PROFILE) +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Include for Windows, operating under WSL +# + +# __ __ _ _ _ +# \ \ / /_ _ _ __(_) __ _| |__ | | ___ ___ +# \ \ / / _` | '__| |/ _` | '_ \| |/ _ \ __| +# \ V / (_| | | | | (_| | |_) | | __\__ \ +# \_/ \__,_|_| |_|\__,_|_.__/|_|\___|___/ +# + +# Minikube executable +MINIKUBE ?= minikube.exe +# Default minikube driver +MINIKUBE_DRIVER ?= hyperv +# set docker env for minikube +MINIKUBE_DOCKER_ENV ?= eval $$($(MINIKUBE) docker-env --shell=bash) && \ + export DOCKER_CERT_PATH=$$(echo $$DOCKER_CERT_PATH | $(win_to_wsl_path)) + +# minikube shell mount for certificates +minikube_cert_mount = $(cert_path):$(cert_path) + +# transform the path from windows to WSL +win_to_wsl_path := sed -e 's|\([A-Z]\):|/\L\1|' -e 's|\\|/|g' + +# find the cert path +cert_path = $(realpath $(shell $(MINIKUBE) docker-env --shell bash | grep DOCKER_CERT_PATH | awk -F "=" '{ print $$2 }' | sed 's/"//g' | $(win_to_wsl_path))/..) + +# _____ _ +# |_ _|_ _ _ __ __ _ ___| |_ ___ +# | |/ _` | '__/ _` |/ _ \ __/ __| +# | | (_| | | | (_| | __/ |_\__ \ +# |_|\__,_|_| \__, |\___|\__|___/ +# |___/ + +# Sets minikube credentials +minikube-post-start: + echo "Creating minikube credentials" + export CERT_PATH=$(cert_path) && \ + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-cluster $(MINIKUBE_PROFILE) \ + --certificate-authority=$$CERT_PATH/ca.crt --server=https://$$($(MINIKUBE) ip):8443 && \ + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-credentials $(MINIKUBE_PROFILE) \ + --client-certificate=$$CERT_PATH/client.crt --client-key=$$CERT_PATH/client.key + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config set-context $(MINIKUBE_PROFILE) \ + --cluster=$(MINIKUBE_PROFILE) --user=$(MINIKUBE_PROFILE) + docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl config use-context $(MINIKUBE_PROFILE)