Skip to content

Commit 451c846

Browse files
author
Vaughn Dice
committed
feat(Makefile): add test target
as well as adding missing includes.mk ref jenkins-jobs#343
1 parent 2ec1404 commit 451c846

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
SHELL = /bin/bash
2+
include includes.mk
23

34
DOCKER_HOST = $(shell echo $$DOCKER_HOST)
45
BUILD_TAG ?= git-$(shell git rev-parse --short HEAD)
56
SHORT_NAME ?= nsq
67
DEIS_REGISTRY ?= ${DEV_REGISTRY}
78
IMAGE_PREFIX ?= deis
89

10+
TEST_ENV_PREFIX := docker run --rm -v ${CURDIR}:/bash -w /bash quay.io/deis/shell-dev
11+
SHELL_SCRIPTS = $(wildcard rootfs/opt/nsq/bin/*)
12+
913
include versioning.mk
1014

1115
build: docker-build
@@ -21,6 +25,11 @@ docker-build:
2125
clean: check-docker
2226
docker rmi $(IMAGE)
2327

28+
test: test-style
29+
30+
test-style: check-docker
31+
${TEST_ENV_PREFIX} shellcheck $(SHELL_SCRIPTS)
32+
2433
update-manifests:
2534
sed 's#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-nsqd-rc.yaml > manifests/deis-nsqd-rc.tmp.yaml
2635

@@ -35,3 +44,6 @@ kube-delete:
3544
kube-update: update-manifests
3645
kubectl delete -f manifests/deis-nsqd-rc.tmp.yaml
3746
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

includes.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SHELL := /bin/bash
2+
3+
check-docker:
4+
@if [ -z $$(which docker) ]; then \
5+
echo "Missing \`docker\` client which is required for development"; \
6+
exit 2; \
7+
fi
8+
9+
check-kubectl:
10+
@if [ -z $$(which kubectl) ]; then \
11+
echo "Missing \`kubectl\` client which is required for development"; \
12+
exit 2; \
13+
fi

rootfs/opt/nsq/bin/start-nsqd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -eo pipefail
33

44
export MAX_READY_COUNT=${MAX_READY_COUNT:-10000}
55
export DATA_PATH=${DATA_PATH:-/opt/nsq/data}
6-
exec nsqd -max-rdy-count ${MAX_READY_COUNT} --data-path ${DATA_PATH}
6+
exec nsqd -max-rdy-count "${MAX_READY_COUNT}" --data-path "${DATA_PATH}"

0 commit comments

Comments
 (0)