@@ -4,6 +4,7 @@ include includes.mk
44DOCKER_HOST = $(shell echo $$DOCKER_HOST)
55BUILD_TAG ?= git-$(shell git rev-parse --short HEAD)
66SHORT_NAME ?= nsq
7+ DEPLOYMENT_NAME ?= nsqd
78DEIS_REGISTRY ?= ${DEV_REGISTRY}
89IMAGE_PREFIX ?= deis
910
@@ -14,9 +15,6 @@ include versioning.mk
1415
1516build : docker-build
1617push : docker-push
17- install : kube-install
18- uninstall : kube-delete
19- upgrade : kube-update
2018
2119docker-build :
2220 docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} rootfs
@@ -30,20 +28,13 @@ test: test-style
3028test-style : check-docker
3129 ${TEST_ENV_PREFIX} shellcheck $(SHELL_SCRIPTS )
3230
33- update-manifests :
34- sed ' s#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-nsqd-rc.yaml > manifests/deis-nsqd-rc.tmp.yaml
31+ deploy : check-kubectl docker-build docker-push
32+ kubectl --namespace=deis patch deployment deis-${DEPLOYMENT_NAME} \
33+ --type=' json' \
34+ -p=' [ \
35+ {" op" : " replace" , " path" : " /spec/strategy" , " value" :{" type" :" Recreate" }}, \
36+ {" op" : " replace" , " path" : " /spec/template/spec/containers/0/image" , " value" :" $( IMAGE) " }, \
37+ {" op" : " replace" , " path" : " /spec/template/spec/containers/0/imagePullPolicy" , " value" :" Always" } \
38+ ]'
3539
36- kube-install : update-manifests
37- kubectl create -f manifests/deis-nsqd-svc.yaml
38- kubectl create -f manifests/deis-nsqd-rc.yaml
39-
40- kube-delete :
41- kubectl delete -f manifests/deis-nsqd-svc.yaml
42- kubectl delete -f manifests/deis-nsqd-rc.yaml
43-
44- kube-update : update-manifests
45- kubectl delete -f manifests/deis-nsqd-rc.tmp.yaml
46- kubectl create -f manifests/deis-nsqd-rc.tmp.yaml
47-
48- .PHONY : build push install uninstall upgrade docker-build clean test test-style \
49- update-manifests kube-install kube-delete kube-update
40+ .PHONY : build push docker-build clean test test-style deploy
0 commit comments