Skip to content

Commit 7ba6255

Browse files
committed
Merge pull request #466 from helgi/make_deploy
feat(make): make deploy to apply the latest RC image for workflow
2 parents 0c94c8b + 11f4074 commit 7ba6255

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ VERSION ?= git-$(shell git rev-parse --short HEAD)
66
IMAGE = $(DEIS_REGISTRY)$(IMAGE_PREFIX)/$(COMPONENT):$(VERSION)
77
SHELL_SCRIPTS = $(wildcard rootfs/bin/*) $(shell find "rootfs" -name '*.sh') $(wildcard _scripts/*.sh)
88

9+
# Get the component informtation to a tmp location and get replica count
10+
$(shell kubectl get rc deis-$(COMPONENT) --namespace deis -o yaml > /tmp/deis-$(COMPONENT))
11+
DESIRED_REPLICAS=$(shell kubectl get -o template rc/deis-$(COMPONENT) --template={{.status.replicas}})
12+
913
info:
1014
@echo "Build tag: ${VERSION}"
1115
@echo "Registry: ${DEIS_REGISTRY}"
@@ -53,6 +57,11 @@ update-manifests:
5357
sed 's#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-workflow-rc.yml \
5458
> manifests/deis-workflow-rc.tmp.yml
5559

60+
deploy: docker-build docker-push
61+
sed 's#\(image:\) .*#\1 $(IMAGE)#' /tmp/deis-$(COMPONENT) | kubectl apply --validate=true -f -
62+
kubectl scale rc deis-workflow --replicas 0 --namespace deis
63+
kubectl scale rc deis-workflow --replicas $(DESIRED_REPLICAS) --namespace deis
64+
5665
clean: check-docker
5766
docker rmi $(IMAGE)
5867

0 commit comments

Comments
 (0)