forked from codeclimate/codeclimate-eslint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 801 Bytes
/
Makefile
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
.PHONY: image test citest integration
IMAGE_NAME ?= codeclimate/codeclimate-eslint
NPM_TEST_TARGET ?= test
NPM_INTEGRATION_TARGET ?= integration
DEBUG ?= false
ifeq ($(DEBUG),true)
NPM_TEST_TARGET = test.debug
NPM_INTEGRATION_TARGET = integration.debug
endif
image:
docker build --rm -t $(IMAGE_NAME) .
integration: yarn.lock
docker run -ti --rm \
-v $(PWD):/usr/src/app \
--workdir /usr/src/app \
$(IMAGE_NAME) npm run $(NPM_INTEGRATION_TARGET)
test: yarn.lock
docker run -ti --rm \
-v $(PWD):/usr/src/app \
--workdir /usr/src/app \
$(IMAGE_NAME) npm run $(NPM_TEST_TARGET)
citest:
docker run --rm \
--workdir /usr/src/app \
$(IMAGE_NAME) sh -c "npm run test && npm run integration"
yarn.lock: package.json Dockerfile
$(MAKE) image
./bin/yarn install
touch yarn.lock