2022-10-25 13:38:56 +02:00
|
|
|
##@ General
|
|
|
|
|
|
|
|
# The help target prints out all targets with their descriptions organized
|
|
|
|
# beneath their categories. The categories are represented by '##@' and the
|
|
|
|
# target descriptions by '##'. The awk commands is responsible for reading the
|
|
|
|
# entire set of makefiles included in this invocation, looking for lines of the
|
|
|
|
# file as xyz: ## something, and then pretty-format the target and help. Then,
|
|
|
|
# if there's a line with ##@ something, that gets pretty-printed as a category.
|
|
|
|
# More info on the usage of ANSI control characters for terminal formatting:
|
|
|
|
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
|
|
|
|
# More info on the awk command:
|
|
|
|
# http://linuxcommand.org/lc3_adv_awk.php
|
|
|
|
|
|
|
|
help: ## Display this help.
|
|
|
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
|
|
|
|
|
|
|
##@ Setup
|
|
|
|
|
2022-11-01 13:04:41 +01:00
|
|
|
up: k3d-create build ## Create a local k3d development cluster.
|
2022-10-25 13:38:56 +02:00
|
|
|
down: k3d-delete ## Delete the local k3d development cluster.
|
|
|
|
|
|
|
|
k3d-create: ## Create a local K3D development cluster.
|
2023-03-28 19:30:51 +02:00
|
|
|
@k3d cluster create fab-city-os-core-dev --config k3d-dev.yaml
|
2022-10-25 13:38:56 +02:00
|
|
|
|
|
|
|
k3d-delete: ## Delete the local K3D development cluster
|
2023-03-28 19:30:51 +02:00
|
|
|
@k3d cluster delete fab-city-os-core-dev
|
2022-10-25 13:38:56 +02:00
|
|
|
|
|
|
|
info: ## Show k3d cluster info
|
|
|
|
@k3d cluster list
|
|
|
|
@kubectl cluster-info
|
|
|
|
|
|
|
|
clean: down up ## Clean the local Kubernetes development cluster.
|
|
|
|
|
|
|
|
##@ Lint
|
|
|
|
|
|
|
|
lint: helm ## Lint all input files.
|
|
|
|
|
|
|
|
lint-yaml: ## Lint YAML files.
|
|
|
|
@yamllint -f auto .
|
|
|
|
|
|
|
|
lint-markdown: ## Lint Markdown files.
|
|
|
|
@mdl .
|
|
|
|
|
|
|
|
lint-chart: ## Lint Charts files.
|
|
|
|
@ct lint
|
|
|
|
|
|
|
|
lint-helm: ## Lint Helm files.
|
|
|
|
@helm lint .
|
|
|
|
|
|
|
|
##@ Show
|
|
|
|
|
|
|
|
get-pods: ## Get Kubernetes pods from all namespaces.
|
|
|
|
@kubectl get --all-namespaces pods
|
|
|
|
|
|
|
|
get-events: ## Get Kubernetes events from all namespaces.
|
|
|
|
@kubectl get --all-namespaces events
|
|
|
|
|
|
|
|
get-all: ## Get the state of all Kubernetes resources.
|
|
|
|
@kubectl get all --all-namespaces
|
|
|
|
|
|
|
|
get-ns: ## Get all Kubernetes namespaces.
|
|
|
|
@kubectl get namespaces
|
|
|
|
|
|
|
|
get-api: ## Get all Kubernetes api resources.
|
|
|
|
@kubectl api-resources
|
|
|
|
|
|
|
|
get-crd: ## Get all Kubernetes api resources.
|
|
|
|
@kubectl get crd
|
|
|
|
|
|
|
|
get-node: ## Get all Kubernetes nodes.
|
|
|
|
@kubectl get nodes -o wide
|
|
|
|
|
|
|
|
watch-all: ## Watch the state of all Kubernetes resources.
|
|
|
|
@watch -n 1 kubectl get all --all-namespaces
|
|
|
|
|
|
|
|
##@ Log
|
|
|
|
|
|
|
|
events: ## Show all Kubernetes cluster events.
|
|
|
|
@kubectl get events --watch --all-namespaces
|
|
|
|
|
2022-11-22 23:26:57 +01:00
|
|
|
##@ Helm
|
|
|
|
|
|
|
|
get-plugins: ## Get the required helm plugins.
|
|
|
|
@helm plugin install https://github.com/chartmuseum/helm-push
|
|
|
|
|
|
|
|
add-repo: ## Add the Gitlab helm repository.
|
2023-03-28 19:30:51 +02:00
|
|
|
@helm repo add fab-city-os-core-beta https://gitlab.fabcity.hamburg/api/v4/projects/248/packages/helm/beta
|
2022-11-22 23:26:57 +01:00
|
|
|
|
|
|
|
update: ## Update helm dependencies.
|
|
|
|
@helm dependency update
|
|
|
|
|
|
|
|
build: ## Build helm dependencies.
|
|
|
|
@helm dependency build
|
|
|
|
|
|
|
|
dry-run: ## Run helm dry run.
|
2023-03-28 19:30:51 +02:00
|
|
|
@helm install --dry-run fab-city-os-core .
|
2022-11-22 23:26:57 +01:00
|
|
|
|
|
|
|
install: ## Run helm install.
|
2023-03-28 19:30:51 +02:00
|
|
|
@helm install fab-city-os-core .
|
2022-11-22 23:26:57 +01:00
|
|
|
|
|
|
|
uninstall: ## Run helm uninstall.
|
2023-03-28 19:30:51 +02:00
|
|
|
@helm uninstall fab-city-os-core || true
|
2022-11-22 23:26:57 +01:00
|
|
|
|
|
|
|
reinstall: uninstall install ## Run helm reinstall.
|
|
|
|
|
2023-02-13 16:45:57 +01:00
|
|
|
deploy: reinstall ## deploy helm chart.
|
|
|
|
|
|
|
|
render: ## Render helm chart.
|
|
|
|
@helm template .
|
|
|
|
|
2022-11-22 23:26:57 +01:00
|
|
|
package: ## Package the helm chart.
|
2022-11-30 12:21:56 +01:00
|
|
|
@helm package . --destination dist
|
2022-10-25 13:38:56 +02:00
|
|
|
|
2022-11-22 23:26:57 +01:00
|
|
|
push: ## Publish the helm chart.
|
2023-03-28 19:30:51 +02:00
|
|
|
@helm cm-push dist/fab-city-os-core-$(grep '^version:' Chart.yaml | awk '{print $2}').tgz fab-city-os-core-beta
|
2022-10-25 13:38:56 +02:00
|
|
|
|
|
|
|
%:
|
|
|
|
@true
|