Commit 2404fe17 by Chavee Issariyapat

Update Makefile

parent 954fa72d
# a helper shell script # a helper shell script
MAKE_VERSION=1.1.6 MAKE_VERSION=1.1.7
define MAKEFUNCTIONCODE define MAKEFUNCTIONCODE
function hasChanges() { function hasChanges() {
...@@ -121,18 +121,19 @@ ifeq (deploy,$(firstword $(MAKECMDGOALS))) ...@@ -121,18 +121,19 @@ ifeq (deploy,$(firstword $(MAKECMDGOALS)))
endif endif
ifdef doit ifdef doit
# use the rest as arguments for "make xxx" # use the rest as arguments for "make xxx"
CMD_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) #CMD_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets # ...and turn them into do-nothing targets
$(eval $(CMD_ARGS):;@:) #$(eval $(CMD_ARGS):;@:)
DEPLOYARG= -n $(n) --context=$(c)
endif endif
ifeq ($(CMD_ARGS),) # ifeq ($(CMD_ARGS),)
else # else
EMPTY= # EMPTY=
SPACE=$(EMPTY) $(EMPTY) # SPACE=$(EMPTY) $(EMPTY)
TDARG = $(subst $(SPACE), --context=,$(CMD_ARGS)) # TDARG = $(subst $(SPACE), --context=,$(CMD_ARGS))
DARG = -n $(TDARG) # DARG = -n $(TDARG)
endif # endif
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showtag show-tag \ .PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showtag show-tag \
...@@ -251,4 +252,5 @@ env-snippet: ...@@ -251,4 +252,5 @@ env-snippet:
@rm env-snippet-nexpieconfig.yaml @rm env-snippet-nexpieconfig.yaml
deploy: init release.conf deploy: init release.conf
@ cat k8s/deployment.yaml | sed "s/{{IMAGE_TAG}}/$(VERSION)/g" | kubectl apply -f - $(DARG) @ cat k8s/deployment.yaml | sed "s/{{IMAGE_TAG}}/$(VERSION)/g" | kubectl apply -f - $(DEPLOYARG)
#@ cat k8s/deployment.yaml | sed "s/{{IMAGE_TAG}}/$(VERSION)/g" | kubectl apply -f - $(DARG)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment