mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-22 00:02:28 +00:00
Squashed '.makefiles/' changes from 21ff551..b20982c
b20982c
Merge branch 'senpy' into 'master'8fe7616
Updated makefiles from senpy1543f55
Updated makefiles from senpyf04cbee
Testing new k8s mk git-subtree-dir: .makefiles git-subtree-split:b20982cae1
This commit is contained in:
parent
21ff551769
commit
b03e03fd0a
10
base.mk
10
base.mk
@ -1,8 +1,13 @@
|
|||||||
|
export
|
||||||
NAME ?= $(shell basename $(CURDIR))
|
NAME ?= $(shell basename $(CURDIR))
|
||||||
VERSION ?= $(shell git describe --tags --dirty 2>/dev/null)
|
VERSION ?= $(shell git describe --tags --dirty 2>/dev/null)
|
||||||
|
|
||||||
# Get the location of this makefile.
|
# Get the location of this makefile.
|
||||||
MK_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
MK_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
|
-include .env
|
||||||
|
-include ../.env
|
||||||
|
|
||||||
.FORCE:
|
.FORCE:
|
||||||
|
|
||||||
version: .FORCE
|
version: .FORCE
|
||||||
@ -13,7 +18,7 @@ help: ## Show this help.
|
|||||||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/\(.*:\)[^#]*##\s*\(.*\)/\1\t\2/' | column -t -s " "
|
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/\(.*:\)[^#]*##\s*\(.*\)/\1\t\2/' | column -t -s " "
|
||||||
|
|
||||||
config: ## Load config from the environment. You should run it once in every session before other tasks. Run: eval $(make config)
|
config: ## Load config from the environment. You should run it once in every session before other tasks. Run: eval $(make config)
|
||||||
@echo ". ../.env || true;"
|
@awk '{ print "export " $$0}' ../.env
|
||||||
@awk '{ print "export " $$0}' .env
|
@awk '{ print "export " $$0}' .env
|
||||||
@echo "# Please, run: "
|
@echo "# Please, run: "
|
||||||
@echo "# eval \$$(make config)"
|
@echo "# eval \$$(make config)"
|
||||||
@ -27,4 +32,7 @@ include $(MK_DIR)/makefiles.mk
|
|||||||
include $(MK_DIR)/docker.mk
|
include $(MK_DIR)/docker.mk
|
||||||
include $(MK_DIR)/git.mk
|
include $(MK_DIR)/git.mk
|
||||||
|
|
||||||
|
info:: ## List all variables
|
||||||
|
env
|
||||||
|
|
||||||
.PHONY:: config help ci version .FORCE
|
.PHONY:: config help ci version .FORCE
|
||||||
|
12
k8s.mk
12
k8s.mk
@ -11,17 +11,16 @@
|
|||||||
#
|
#
|
||||||
# Check if the KUBE_CA_PEM_FILE exists. Otherwise, create it from KUBE_CA_BUNDLE
|
# Check if the KUBE_CA_PEM_FILE exists. Otherwise, create it from KUBE_CA_BUNDLE
|
||||||
KUBE_CA_TEMP=false
|
KUBE_CA_TEMP=false
|
||||||
ifeq ($(wildcard $(KUBE_CA_PEM_FILE)),)
|
ifndef KUBE_CA_PEM_FILE
|
||||||
KUBE_CA_PEM_FILE:="$$PWD/.ca.crt"
|
KUBE_CA_PEM_FILE:=$$PWD/.ca.crt
|
||||||
CREATED:=$(shell echo -e "$$KUBE_CA_BUNDLE" > $(KUBE_CA_PEM_FILE))
|
CREATED:=$(shell echo -e "$(KUBE_CA_BUNDLE)" > $(KUBE_CA_PEM_FILE))
|
||||||
endif
|
endif
|
||||||
KUBE_URL?=""
|
|
||||||
KUBE_TOKEN?=""
|
KUBE_TOKEN?=""
|
||||||
KUBE_NAMESPACE?=$(NAME)
|
KUBE_NAMESPACE?=$(NAME)
|
||||||
KUBECTL=docker run --rm -v $(KUBE_CA_PEM_FILE):/tmp/ca.pem -i lachlanevenson/k8s-kubectl --server="$(KUBE_URL)" --token="$(KUBE_TOKEN)" --certificate-authority="/tmp/ca.pem" -n $(KUBE_NAMESPACE)
|
KUBECTL=docker run --rm -v $(KUBE_CA_PEM_FILE):/tmp/ca.pem -i lachlanevenson/k8s-kubectl --server="$(KUBE_URL)" --token="$(KUBE_TOKEN)" --certificate-authority="/tmp/ca.pem" -n $(KUBE_NAMESPACE)
|
||||||
CI_COMMIT_REF_NAME?=master
|
CI_COMMIT_REF_NAME?=master
|
||||||
|
|
||||||
info: ## Print variables. Useful for debugging.
|
info:: ## Print variables. Useful for debugging.
|
||||||
@echo "#KUBERNETES"
|
@echo "#KUBERNETES"
|
||||||
@echo KUBE_URL=$(KUBE_URL)
|
@echo KUBE_URL=$(KUBE_URL)
|
||||||
@echo KUBE_CA_PEM_FILE=$(KUBE_CA_PEM_FILE)
|
@echo KUBE_CA_PEM_FILE=$(KUBE_CA_PEM_FILE)
|
||||||
@ -35,6 +34,7 @@ info: ## Print variables. Useful for debugging.
|
|||||||
@echo CI_REGISTRY=$(CI_REGISTRY)
|
@echo CI_REGISTRY=$(CI_REGISTRY)
|
||||||
@echo CI_REGISTRY_USER=$(CI_REGISTRY_USER)
|
@echo CI_REGISTRY_USER=$(CI_REGISTRY_USER)
|
||||||
@echo CI_COMMIT_REF_NAME=$(CI_COMMIT_REF_NAME)
|
@echo CI_COMMIT_REF_NAME=$(CI_COMMIT_REF_NAME)
|
||||||
|
@echo "CREATED=$(CREATED)"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Deployment and advanced features
|
# Deployment and advanced features
|
||||||
@ -42,7 +42,7 @@ info: ## Print variables. Useful for debugging.
|
|||||||
|
|
||||||
|
|
||||||
deploy: ## Deploy to kubernetes using the credentials in KUBE_CA_PEM_FILE (or KUBE_CA_BUNDLE ) and TOKEN
|
deploy: ## Deploy to kubernetes using the credentials in KUBE_CA_PEM_FILE (or KUBE_CA_BUNDLE ) and TOKEN
|
||||||
@ls k8s/
|
@ls k8s/*.yaml k8s/*.yml k8s/*.tmpl 2>/dev/null || true
|
||||||
@cat k8s/*.yaml k8s/*.yml k8s/*.tmpl 2>/dev/null | envsubst | $(KUBECTL) apply -f -
|
@cat k8s/*.yaml k8s/*.yml k8s/*.tmpl 2>/dev/null | envsubst | $(KUBECTL) apply -f -
|
||||||
|
|
||||||
deploy-check: ## Get the deployed configuration.
|
deploy-check: ## Get the deployed configuration.
|
||||||
|
Loading…
Reference in New Issue
Block a user