forked from department-of-veterans-affairs/vets-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.18 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
62
63
64
65
66
67
COMPOSE_DEV := docker-compose
COMPOSE_TEST := docker-compose -f docker-compose.test.yml
BASH := run --rm --service-ports vets-api bash
BASH_DEV := $(COMPOSE_DEV) $(BASH) -c
BASH_TEST := $(COMPOSE_TEST) $(BASH) --login -c
SPEC_PATH := spec/
.PHONY: default
default: ci
.PHONY: bash
bash:
@$(COMPOSE_DEV) $(BASH)
.PHONY: ci
ci:
@$(BASH_TEST) "bin/rails db:setup db:migrate ci"
.PHONY: clean
clean:
rm -r data || true
$(COMPOSE_TEST) run vets-api rm -r coverage log tmp || true
$(COMPOSE_TEST) down
.PHONY: console
console:
@$(BASH_DEV) "bundle exec rails c"
.PHONY: db
db:
@$(BASH_DEV) "bin/rails db:setup db:migrate"
.PHONY: down
down:
@$(COMPOSE_DEV) down
.PHONY: guard
guard:
@$(BASH_DEV) "bundle exec guard"
.PHONY: lint
lint:
@$(BASH_DEV) "bin/rails lint"
.PHONY: migrate
migrate:
@$(BASH_TEST) "bin/rails db:migrate"
.PHONY: rebuild
rebuild: down
@$(COMPOSE_DEV) build
.PHONY: security
security:
@$(BASH_DEV) "bin/rails security"
.PHONY: server
server:
@$(BASH_DEV) "rm -f tmp/pids/server.pid && bundle exec rails server"
.PHONY: spec
spec:
@$(BASH_TEST) "bin/rspec ${SPEC_PATH}"
.PHONY: up
up: db
@$(BASH_DEV) "rm -f tmp/pids/server.pid && foreman start"