Skip to content

Refactor Makefiles #83

Closed
Closed

Description

@kvaps

As part of #76

Let's create common Makefile ./hack/package-system.mk with the folowing content:

.DEFAULT_GOAL=help
.PHONY=help show diff apply delete update image

help: ## Show this help.
	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

show: ## Show output of rendered templates
	helm template --dry-run=server -n $(NAMESPACE) $(NAME) .

apply: suspend ## Apply Helm release to a Kubernetes cluster 
	helm upgrade -i -n $(NAMESPACE) $(NAME) .

diff: ## Diff Helm release against objects in a Kubernetes cluster
	helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .

suspend: ## Suspend reconciliation for an existing Helm release
	flux suspend hr -n $(NAMESPACE) $(NAME)

resume: ## Resume reconciliation for an existing Helm release
	flux resume hr -n $(NAMESPACE) $(NAME)

And include it in every packages/system/* package:

include ../../hack/package-system.mk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions