-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (47 loc) · 1.28 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
ifeq ($(shell which docker-compose),)
DOCKER-COMPOSE = docker compose
else
DOCKER-COMPOSE = docker-compose
endif
DOCKER-RUN = $(DOCKER-COMPOSE) run --rm --entrypoint=""
BUNDLE-EXEC = bundle exec
build:
$(DOCKER-COMPOSE) build
up:
$(DOCKER-COMPOSE) up web db redis worker
down:
$(DOCKER-COMPOSE) down
.PHONY: db
db:
$(DOCKER-RUN) db psql -U postgres -h db -d development
sh:
$(DOCKER-RUN) web $(BUNDLE-EXEC) bash
lint:
$(DOCKER-RUN) web $(BUNDLE-EXEC) rubocop
fix-lint:
$(DOCKER-RUN) web $(BUNDLE-EXEC) rubocop -A
js-lint:
$(DOCKER-RUN) web standard app/javascript
yaml-lint:
$(DOCKER-RUN) web prettier "config/**/*.yaml" "config/**/*.yml" "!config/cucumber.yml"
fix-yaml-lint:
$(DOCKER-RUN) web prettier --write "config/**/*.yaml" "config/**/*.yml" "!config/cucumber.yml"
security:
$(DOCKER-RUN) web $(BUNDLE-EXEC) ./bin/brakeman
guard:
$(DOCKER-COMPOSE) up -d chrome
$(DOCKER-RUN) web $(BUNDLE-EXEC) guard
tests:
$(DOCKER-COMPOSE) up -d chrome
$(DOCKER-RUN) web $(BUNDLE-EXEC) rspec
e2e:
$(DOCKER-COMPOSE) up -d chrome
$(DOCKER-RUN) web $(BUNDLE-EXEC) cucumber
console:
$(DOCKER-RUN) web bin/rails console
restart:
$(DOCKER-COMPOSE) exec web touch tmp/restart.txt
replant:
$(DOCKER-RUN) web bin/rails db:seed:replant
prepare_db:
$(DOCKER-RUN) web bin/rails db:schema:load