add prune job to makefile
This commit is contained in:
parent
598dd7da2b
commit
712002c6d2
5
Makefile
5
Makefile
|
@ -6,6 +6,7 @@ KUBECTLFLAGS =
|
|||
KUBECTLDIFFFLAGS =
|
||||
KUBECTLDIFFPRINTER = highlight --out-format xterm256 --syntax diff
|
||||
KUBECTLAPPLYFLAGS = --server-side --force-conflicts
|
||||
KUBECTLAPPLYPRUNEFLAGS = --server-side --force-conflicts --prune
|
||||
KUBECTLAPPLYPRINTER = sed -E -e 's/(.+configured)/\o033[32m\1\o033[0m/g' -e 's/(.+pruned)/\o033[31m\1\o033[0m/g'
|
||||
|
||||
SRC := $(shell find kustomize/ -type f)
|
||||
|
@ -25,6 +26,10 @@ diff: $(PRODOUT)
|
|||
apply: $(PRODOUT)
|
||||
$(KUBECTL) $(KUBECTLFLAGS) apply $(KUBECTLAPPLYFLAGS) -l app.kubernetes.io/managed-by=kustomize -f $(PRODOUT) | $(KUBECTLAPPLYPRINTER)
|
||||
|
||||
.PHONY: apply-prune
|
||||
apply-prune: $(PRODOUT)
|
||||
$(KUBECTL) $(KUBECTLFLAGS) apply $(KUBECTLAPPLYPRUNEFLAGS) -l app.kubernetes.io/managed-by=kustomize -f $(PRODOUT) | $(KUBECTLAPPLYPRINTER)
|
||||
|
||||
$(PRODOUT): $(SRC)
|
||||
mkdir -p $(OUT)
|
||||
$(KUSTOMIZE) build $(KUSTOMIZEFLAGS) $(PRODSRC) >$(PRODOUT) || (rm $(PRODOUT); exit 1)
|
||||
|
|
Loading…
Reference in New Issue