Skip to content

Commit d39ea43

Browse files
author
Vaughn Dice
committed
feat(Makefile): add test-style target
1 parent d3c2b63 commit d39ea43

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ include includes.mk versioning.mk
99
# the filepath to this repository, relative to $GOPATH/src
1010
REPO_PATH = github.com/deis/registry
1111

12+
SHELL_SCRIPTS = $(wildcard _scripts/*.sh contrib/ci/*.sh)
13+
1214
# The following variables describe the containerized development environment
1315
# and other build options
1416
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.20.0
@@ -43,10 +45,13 @@ build-binary:
4345
$(call check-static-binary,$(BINDIR)/${SHORT_NAME})
4446
${DEV_ENV_CMD} upx -9 --brute $(BINDIR)/${SHORT_NAME}
4547

46-
test: check-docker
48+
test: check-docker test-style
4749
contrib/ci/test.sh ${IMAGE}
4850

51+
test-style:
52+
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)
53+
4954
deploy: check-kubectl docker-build docker-push
5055
kubectl --namespace=deis patch deployment deis-$(SHORT_NAME) --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}]'
5156

52-
.PHONY: all build build-binary docker-build test deploy
57+
.PHONY: all build build-binary docker-build test test-style deploy

contrib/ci/test.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
set -eoxf pipefail
44

5-
JOB=$(docker run -d $1)
5+
JOB=$(docker run -d "$1")
66
# let the registry run for a few seconds
77
sleep 5
88
# check that the registry is still up
9-
docker logs $JOB
10-
docker ps -q --no-trunc=true | grep $JOB
11-
docker rm -f $JOB
9+
docker logs "${JOB}"
10+
docker ps -q --no-trunc=true | grep "${JOB}"
11+
docker rm -f "${JOB}"

0 commit comments

Comments
 (0)