From e5a8a0701a4ab0bf7976b3fca8e4c4f32b9fc8ba Mon Sep 17 00:00:00 2001 From: Will Fleming Date: Tue, 9 Feb 2016 12:14:23 -0500 Subject: [PATCH 1/3] add Makefile --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..739d039 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: image test + +IMAGE_NAME ?= codeclimate/codeclimate-fixme + +image: + docker build --rm -t $(IMAGE_NAME) . + +test: image + docker run --rm $(IMAGE_NAME) npm test From 7d2b8b5124793ba1ff22963e483903e8e72e47a9 Mon Sep 17 00:00:00 2001 From: Will Fleming Date: Tue, 9 Feb 2016 12:19:15 -0500 Subject: [PATCH 2/3] Dockerfile: tag base image, add maintainer email Tagging a base image is good practice regardless. The slim variant also shaves ~400MB off our final image. And having a maintainer email is nice. --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7ff924..8a85199 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ -FROM node - -MAINTAINER Michael R. Bernstein +FROM node:5.5-slim +MAINTAINER Michael R. Bernstein WORKDIR /usr/src/app/ From 14615d161a9d283cf9796855b86a188192876cce Mon Sep 17 00:00:00 2001 From: Will Fleming Date: Tue, 9 Feb 2016 12:21:07 -0500 Subject: [PATCH 3/3] Update circle.yml to use Makefile Use the makefile to build & tag the image, as well as run tests in it. --- circle.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/circle.yml b/circle.yml index 63d9dec..5d2b724 100644 --- a/circle.yml +++ b/circle.yml @@ -9,13 +9,11 @@ machine: CODECLIMATE_DOCKER_REGISTRY_EMAIL: ops@codeclimate.com dependencies: - override: - - docker build -t=$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM . - - npm install + override: #no-op test: override: - - npm test + - IMAGE_NAME="$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM" make test deployment: registry: