forked from qltysh/qlty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (53 loc) · 1.77 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: install uninstall image test citest bundle
PREFIX ?= /usr/local
SKIP_ENGINES ?= 0
image:
docker pull "$(shell grep FROM Dockerfile | sed 's/FROM //')"
docker build -t codeclimate/codeclimate .
test: RSPEC_ARGS ?= --tag ~slow
test: image
docker run --rm -it \
--entrypoint bundle \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir /usr/src/app \
codeclimate/codeclimate exec rspec $(RSPEC_ARGS)
test_all: image
docker run --rm -it \
--entrypoint bundle \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir /usr/src/app \
codeclimate/codeclimate exec rake spec:all spec:benchmark
citest:
docker rm codeclimate-cli-test || true
docker run \
--name codeclimate-cli-test \
--entrypoint sh \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir /usr/src/app \
codeclimate/codeclimate -c "bundle exec rake spec:all"
mkdir -p coverage
docker cp codeclimate-cli-test:/usr/src/app/coverage/. ./coverage/
./cc-test-reporter after-build --prefix /usr/src/app/
docker run \
--entrypoint sh \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir /usr/src/app \
codeclimate/codeclimate -c "bundle exec rake spec:benchmark"
install:
bin/check
docker pull codeclimate/codeclimate:latest
@[ $(SKIP_ENGINES) -eq 1 ] || \
docker images | \
awk '/codeclimate\/codeclimate-/ { print $$1 }' | \
xargs -n1 docker pull 2>/dev/null || true
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m 0755 codeclimate-wrapper $(DESTDIR)$(PREFIX)/bin/codeclimate
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/codeclimate
docker rmi codeclimate/codeclimate:latest
bundle:
docker run --rm \
--entrypoint bundle \
--volume $(PWD):/usr/src/app \
--workdir /usr/src/app \
codeclimate/codeclimate $(BUNDLE_ARGS)