1
0
Fork 0

update kustomize

This commit is contained in:
Massaki Archambault 2022-09-13 10:37:49 -04:00
parent c2c5aff42f
commit c91ba777f0
3 changed files with 31 additions and 23 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "plugins"]
path = plugins
url = https://github.com/badjware/kustomize-plugins

View File

@ -1,5 +1,5 @@
KUSTOMIZE = docker run -v $(HOME)/.aws:/root/.aws:ro -v $(PWD):/host -w /host badjware/kustomize-plugins:latest
KUSTOMIZEFLAGS = --enable_alpha_plugins
KUSTOMIZE = KUSTOMIZE_PLUGIN_HOME=$(PWD)/plugins kustomize
KUSTOMIZEFLAGS = --enable-alpha-plugins
KUBECTL = kubectl
KUBECTLFLAGS =
@ -9,11 +9,11 @@ KUBECTLAPPLYFLAGS = --prune
SRC := $(shell find kustomize/ -type f)
OUTDIR = build
DEVOUT = $(OUTDIR)/dev
DEVMANIFESTSRC = kustomize/overlays/dev
DEVMANIFESTOUT = $(DEVOUT)/manifest.yaml
DEVCLUSTERSRC = kustomize/overlays/dev-cluster
DEVCLUSTEROUT = $(DEVOUT)/cluster.yaml
# DEVOUT = $(OUTDIR)/dev
# DEVMANIFESTSRC = kustomize/overlays/dev
# DEVMANIFESTOUT = $(DEVOUT)/manifest.yaml
# DEVCLUSTERSRC = kustomize/overlays/dev-cluster
# DEVCLUSTEROUT = $(DEVOUT)/cluster.yaml
PRODOUT = $(OUTDIR)/prod
PRODMANIFESTOUT = $(PRODOUT)/manifest.yaml
@ -21,17 +21,21 @@ PRODMANIFESTSRC = kustomize/overlays/prod
PRODCLUSTEROUT = $(PRODOUT)/cluster.yaml
PRODCLUSTERSRC = kustomize/overlays/prod-cluster
ifeq ($(environment),prod)
environment = prod
# ifeq ($(environment),prod)
# environment = prod
ENVOUTDIR = $(PRODOUT)
ENVOUTFILE = $(PRODMANIFESTOUT) $(PRODCLUSTEROUT)
else
environment = dev
# ENVOUTDIR = $(PRODOUT)
# ENVOUTFILE = $(PRODMANIFESTOUT) $(PRODCLUSTEROUT)
# else
# environment = dev
ENVOUTDIR = $(DEVOUT)
ENVOUTFILE = $(DEVMANIFESTOUT) $(DEVCLUSTERTOUT)
endif
# ENVOUTDIR = $(DEVOUT)
# ENVOUTFILE = $(DEVMANIFESTOUT) $(DEVCLUSTERTOUT)
# endif
environment=prod
ENVOUTDIR = $(PRODOUT)
ENVOUTFILE = $(PRODMANIFESTOUT) $(PRODCLUSTEROUT)
.PHONY: diff
diff: $(environment)
@ -44,16 +48,16 @@ apply: $(environment)
.PHONY: all dev prod
all: dev prod
dev: $(DEVMANIFESTOUT) $(DEVCLUSTEROUT)
# dev: $(DEVMANIFESTOUT) $(DEVCLUSTEROUT)
prod: $(PRODMANIFESTOUT) $(PRODCLUSTEROUT)
$(DEVMANIFESTOUT): $(SRC)
mkdir -p $(DEVOUT)
$(KUSTOMIZE) build $(KUSTOMIZEFLAGS) $(DEVMANIFESTSRC) >$(DEVMANIFESTOUT) || (rm $(DEVMANIFESTOUT); exit 1)
# $(DEVMANIFESTOUT): $(SRC)
# mkdir -p $(DEVOUT)
# $(KUSTOMIZE) build $(KUSTOMIZEFLAGS) $(DEVMANIFESTSRC) >$(DEVMANIFESTOUT) || (rm $(DEVMANIFESTOUT); exit 1)
$(DEVCLUSTEROUT): $(SRC)
mkdir -p $(DEVOUT)
$(KUSTOMIZE) build $(KUSTOMIZEFLAGS) $(DEVCLUSTERSRC) >$(DEVCLUSTEROUT) || (rm $(DEVCLUSTEROUT); exit 1)
# $(DEVCLUSTEROUT): $(SRC)
# mkdir -p $(DEVOUT)
# $(KUSTOMIZE) build $(KUSTOMIZEFLAGS) $(DEVCLUSTERSRC) >$(DEVCLUSTEROUT) || (rm $(DEVCLUSTEROUT); exit 1)
$(PRODMANIFESTOUT): $(SRC)
mkdir -p $(PRODOUT)

1
plugins Submodule

@ -0,0 +1 @@
Subproject commit 323a2f9a62df1215b3bb4d60a0ebdd1a0bc15c0f