-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathMakefile
45 lines (42 loc) · 1.54 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
dc=docker compose -f docker-compose.yml $(1)
dc-run=$(call dc, run --rm web $(1))
dc-run-sp=$(call dc, run --service-ports --rm web $(1))
usage:
@echo "Available targets:"
@echo " * setup - Initiates everything (building images, installing gems, creating db and migrating"
@echo " * build - Build image"
@echo " * bundle - Install missing gems"
@echo " * db-migrate - Runs the migrations for dev database"
@echo " * db-test-migrate - Runs the migrations for test database"
@echo " * seed - Seeds dev database with example profiles, and indexes them in Elasticsearch"
@echo " * dev - Fires a shell inside your container"
@echo " * up - Runs the development server"
@echo " * tear-down - Removes all the containers and tears down the setup"
@echo " * stop - Stops the server"
@echo " * test - Runs all tests"
# With db
setup: build bundle db-create db-migrate db-test-migrate
build:
$(call dc, build)
bundle:
$(call dc-run, bundle install)
dev:
$(call dc-run, bash)
up:
$(call dc-run-sp)
tear-down:
$(call dc, down)
stop:
$(call dc, stop)
console:
$(call dc-run, bundle exec rails console)
db-create:
$(call dc-run, bundle exec rake db:create)
db-migrate:
$(call dc-run, bundle exec rake db:migrate)
db-test-migrate:
$(call dc-run, bundle exec rake db:migrate RAILS_ENV=test)
seed:
$(call dc-run, sh -c 'rake db:seed')
test:
$(call dc-run-sp, sh -c 'bundle exec rspec')