-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile
41 lines (38 loc) · 1.33 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
dc=docker-compose -f docker-compose.yml $(1)
dc-run=$(call dc, run --rm web $(1))
usage:
@echo "Available targets:"
@echo " * setup - Initiates everything (building images, installing gems, creating db and migrating"
@echo " * build - Builds all images"
@echo " * update-deps - Installs missing runtime dependencies (installs bundle)"
@echo " * db-migrate - Runs the migrations for development db"
@echo " * db-test-migrate - Runs the migrations for the test db"
@echo " * dev - Starts and connects to the docker container"
@echo " * run - Runs the development server"
@echo " * tear-down - Removes all the containers and tears down the setup"
@echo " * stop - Stops the server and the database containers"
@echo " * rspec - Runs rspec"
setup: build update-deps db-create db-migrate
build:
$(call dc, build)
update-deps:
$(call dc-run, bundle install)
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, RAILS_ENV=test rake db:migrate)
dev:
$(call dc-run, ash)
console:
$(call dc-run, bundle exec rails console)
run:
$(call dc, up)
tear-down:
$(call dc, down)
stop:
$(call dc, stop)
.PHONY: rspec
rspec:
$(call dc-run, bundle exec rspec)