-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 1.36 KB
/
Makefile
File metadata and controls
64 lines (49 loc) · 1.36 KB
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
##############################
# General commands
##############################
# Open a shell to your development container
.PHONY: dev-shell
dev-shell:
docker exec -it $$(docker ps -q -f name=dev) /bin/bash
# Run & build all containers
.PHONY: dev
dev:
docker compose up --build
# Run all containers without rebuilding
.PHONY: dev-quick
dev-quick:
docker compose up
# Stop all running containers
.PHONY: down
down:
docker compose down
##############################
# Rails app commands
##############################
# Open a bash shell in the running app container
.PHONY: app-shell
app-shell:
docker exec -it $$(docker ps -q -f name=app) /bin/bash
# Open a Rails console
.PHONY: app-console
app-console:
docker exec -it $$(docker ps -q -f name=app) rails c
# Run all Rspec tests
.PHONY: app-rspec
app-rspec:
docker exec -it $$(docker ps -q -f name=app) rspec spec
##############################
# Database commands
##############################
# Open a bash shell in the running db container
.PHONY: db-shell
db-shell:
docker exec -it $$(docker ps -q -f name=db) /bin/bash
# Open a connection to the development database
.PHONY: db-dev
db-dev:
docker exec -it $$(docker ps -q -f name=db) psql -U postgres -d app_development
# Open a connection to the test database
.PHONY: db-test
db-test:
docker exec -it $$(docker ps -q -f name=db) psql -U postgres -d app_test