This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (44 loc) · 1.57 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
.PHONY: install uninstall image test citest
PREFIX ?= /usr/local
SKIP_ENGINES ?= 0
image:
docker build -t codeclimate/codeclimate .
test: image
docker run --rm -it \
--entrypoint bundle \
--volume /var/run/docker.sock:/var/run/docker.sock \
codeclimate/codeclimate exec rspec $(RSPEC_ARGS)
test_all: image
docker run --rm -it \
--entrypoint bundle \
--volume /var/run/docker.sock:/var/run/docker.sock \
codeclimate/codeclimate exec rake spec:all spec:benchmark
citest:
docker run \
--entrypoint sh \
--env CIRCLECI=$(CIRCLECI) \
--env CIRCLE_BUILD_NUM=$(CIRCLE_BUILD_NUM) \
--env CIRCLE_BRANCH=$(CIRCLE_BRANCH) \
--env CIRCLE_SHA1=$(CIRCLE_SHA1) \
--env CODECLIMATE_REPO_TOKEN=$(CODECLIMATE_REPO_TOKEN) \
--volume $(PWD)/.git:/usr/src/app/.git:ro \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume $(CIRCLE_TEST_REPORTS):/usr/src/app/spec/reports \
codeclimate/codeclimate -c "bundle exec rake spec:all && bundle exec codeclimate-test-reporter && 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
Gemfile.lock: image
docker run --rm \
--entrypoint sh \
--volume $(PWD):/usr/src/app \
codeclimate/codeclimate -c bundle