-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
68 lines (47 loc) · 1.4 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
68
RAILS_ENV ?= development
PROJECT_NAME := interview-api
RUN := run --rm
DOCKER_COMPOSE_FILES := -f docker-compose.yml
DOCKER_COMPOSE := docker-compose $(DOCKER_COMPOSE_FILES) --project-name $(PROJECT_NAME)
DOCKER_COMPOSE_RUN := $(DOCKER_COMPOSE) $(RUN)
WEB_CONCURRENCY := 0
default: bin-rspec
bin-rspec:
bin/rspec
provision: bundle db-migrate
up:
rm -f tmp/pids/server.pid && ${DOCKER_COMPOSE} up
api:
${DOCKER_COMPOSE_RUN} --service-ports -e "WEB_CONCURRENCY=${WEB_CONCURRENCY}" api
db-migrate:
${DOCKER_COMPOSE_RUN} -e "RAILS_ENV=${RAILS_ENV}" app bundle exec rake db:migrate
db-rollback:
${DOCKER_COMPOSE_RUN} -e "RAILS_ENV=${RAILS_ENV}" app bundle exec rake db:rollback
db-seed:
${DOCKER_COMPOSE_RUN} -e "RAILS_ENV=${RAILS_ENV}" app bundle exec rake db:seed
bash:
${DOCKER_COMPOSE_RUN} -e "RAILS_ENV=${RAILS_ENV}" app bash
rails-console:
${DOCKER_COMPOSE_RUN} -e "RAILS_ENV=${RAILS_ENV}" app bundle exec rails c
job:
${DOCKER_COMPOSE_RUN} sidekiq
compose:
${DOCKER_COMPOSE} ${CMD}
down:
${DOCKER_COMPOSE} down
down-v:
${DOCKER_COMPOSE} down -v
bundle:
${DOCKER_COMPOSE_RUN} app bundle ${CMD}
test:
${DOCKER_COMPOSE_RUN} -e "RAILS_ENV=test" app bundle exec rspec ${T}
psql:
${DOCKER_COMPOSE_RUN} app psql postgresql://postgres@db/interview_${RAILS_ENV}
build:
${DOCKER_COMPOSE} build
rebuild:
${DOCKER_COMPOSE} build --force-rm
rubocop:
${DOCKER_COMPOSE_RUN} app rubocop
ps:
${DOCKER_COMPOSE} ps