File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
1212DEV_ENV_PREFIX := docker run --rm -e GO15VENDOREXPERIMENT=1 -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
1313DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
1414
15+ # Get the component informtation to a tmp location and get replica count
16+ KUBE := $(shell which kubectl)
17+ ifdef KUBE
18+ $(shell kubectl get rc deis-$(SHORT_NAME) --namespace deis -o yaml > /tmp/deis-$(SHORT_NAME))
19+ DESIRED_REPLICAS =$(shell kubectl get -o template rc/deis-$(SHORT_NAME ) --template={{.status.replicas}} --namespace deis)
20+ endif
21+
1522# SemVer with build information is defined in the SemVer 2 spec, but Docker
1623# doesn't allow +, so we use -.
1724BINARY_DEST_DIR := rootfs/usr/bin
@@ -56,4 +63,9 @@ docker-build: build
5663docker-push :
5764 docker push ${IMAGE}
5865
66+ deploy : docker-build docker-push
67+ sed ' s#\(image:\) .*#\1 $(IMAGE)#' /tmp/deis-$(SHORT_NAME ) | kubectl apply --validate=true -f -
68+ kubectl scale rc deis-$(SHORT_NAME ) --replicas 0 --namespace deis
69+ kubectl scale rc deis-$(SHORT_NAME ) --replicas $(DESIRED_REPLICAS ) --namespace deis
70+
5971.PHONY : all build docker-compile kube-up kube-down deploy
You can’t perform that action at this time.
0 commit comments