mirror of
https://gitlab.fabcity.hamburg/software/fab-city-os-core-chart.git
synced 2024-09-20 04:18:52 +02:00
114 lines
3.2 KiB
Makefile
114 lines
3.2 KiB
Makefile
##@ 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
|
|
|
|
up: k3d-create build ## Create a local k3d development cluster.
|
|
down: k3d-delete ## Delete the local k3d development cluster.
|
|
|
|
k3d-create: ## Create a local K3D development cluster.
|
|
@k3d cluster create fcoscore-dev --config k3d-dev.yaml
|
|
|
|
k3d-delete: ## Delete the local K3D development cluster
|
|
@k3d cluster delete fcoscore-dev
|
|
|
|
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
|
|
|
|
##@ Helm
|
|
|
|
get-plugins: ## Get the required helm plugins.
|
|
@helm plugin install https://github.com/chartmuseum/helm-push
|
|
|
|
add-repo: ## Add the Gitlab helm repository.
|
|
@helm repo add fcoscore-alpha https://gitlab.fabcity.hamburg/api/v4/projects/248/packages/helm/alpha
|
|
|
|
update: ## Update helm dependencies.
|
|
@helm dependency update
|
|
|
|
build: ## Build helm dependencies.
|
|
@helm dependency build
|
|
|
|
dry-run: ## Run helm dry run.
|
|
@helm install --dry-run fcoscore .
|
|
|
|
install: ## Run helm install.
|
|
@helm install fcoscore .
|
|
|
|
uninstall: ## Run helm uninstall.
|
|
@helm uninstall fcoscore || true
|
|
|
|
reinstall: uninstall install ## Run helm reinstall.
|
|
|
|
package: ## Package the helm chart.
|
|
@helm package . --destination charts
|
|
|
|
push: ## Publish the helm chart.
|
|
@helm cm-push charts/fcoscore-*.tgz fcoscore-chart
|
|
|
|
%:
|
|
@true
|