-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefault.mk
More file actions
44 lines (34 loc) · 1.35 KB
/
default.mk
File metadata and controls
44 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
SHELL := /bin/bash
# all monitor components share/use the following targets/exports
DOCKER_HOST = $(shell echo $$DOCKER_HOST)
BUILD_TAG ?= git-$(shell git rev-parse --short HEAD)
DEIS_REGISTRY ?= ${DEV_REGISTRY}
IMAGE_PREFIX ?= deis
include ../includes.mk
include ../versioning.mk
TEST_ENV_PREFIX := docker run --rm -v ${CURDIR}:/bash -w /bash quay.io/deis/shell-dev
build: docker-build
push: docker-push
deploy: check-kubectl docker-build docker-push upgrade
docker-build:
docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} rootfs
docker tag ${IMAGE} ${MUTABLE_IMAGE}
clean: check-docker
docker rmi $(IMAGE)
KD = kubectl --namespace=deis
upgrade:
${KD} patch ${RESOURCE_TYPE} deis-monitor-${SHORT_NAME} \
--type='json' \
-p='[ \
{"op": "replace", "path": "/spec/strategy", "value":{"type":"Recreate"}}, \
{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}, \
{"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value":"Always"} \
]'
@if [ "${RESOURCE_TYPE}" == "daemonset" ]; then \
echo "Deleting daemonset pods as they aren't yet recreated when daemonset is patched..."; \
${KD} delete $$(${KD} get pod -o name | grep "${SHORT_NAME}"); \
fi
test: test-style
test-style:
${TEST_ENV_PREFIX} shellcheck $(SHELL_SCRIPTS)
.PHONY: build push docker-build clean upgrade deploy test test-style