-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
43 lines (36 loc) · 1.04 KB
/
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
38
39
40
41
42
43
.PHONY: image mongodb-test-server test citest irb
DOCKER_RUN ?= docker run --rm
MONGODB_URI ?= mongodb://mongodb/minidoc_test
image:
docker build -t codeclimate/minidoc .
mongodb-test-server:
docker network inspect minidoc >/dev/null || docker network create minidoc
docker run \
--detach \
--rm \
--network minidoc \
--name mongodb \
circleci/mongo:3.2
test:
$(DOCKER_RUN) -it \
--network minidoc \
--env MONGODB_URI="$(MONGODB_URI)" \
--volume "$(PWD)":/app \
codeclimate/minidoc bundle exec rspec $(RSPEC_ARGS)
citest:
docker run \
--network minidoc \
--env MONGODB_URI="mongodb://mongodb/minidoc_test" \
--env CI="true" \
--name "minidoc-${CIRCLE_WORKFLOW_ID}" \
codeclimate/minidoc bundle exec rspec
docker cp "minidoc-${CIRCLE_WORKFLOW_ID}":/app/coverage ./coverage
irb: image
$(DOCKER_RUN) -it \
--env MONGODB_URI="$(MONGODB_URI)" \
--volume "$(PWD)":/app \
codeclimate/minidoc irb -I lib -r minidoc
bundle:
$(DOCKER_RUN) \
--volume "$(PWD)":/app \
codeclimate/minidoc bundle $(BUNDLE_ARGS)