-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.35 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
init:
devbox install && \
devbox run initdb && \
sed -i "s/#port = 5432/port = 5434/g" ./.devbox/virtenv/postgresql/data/postgresql.conf && \
sed -i "s/#log_statement = 'none'/log_statement = 'all'/g" ./.devbox/virtenv/postgresql/data/postgresql.conf && \
sed -i "s/#logging_collector = off/logging_collector = on/g" ./.devbox/virtenv/postgresql/data/postgresql.conf && \
sed -i "s/#log_directory = 'log'/log_directory = 'log'/g" ./.devbox/virtenv/postgresql/data/postgresql.conf
create:
devbox run "createdb -p 5434 bemi_dev_source && \
createuser -p 5434 --superuser --replication postgres && \
psql -p 5434 -U postgres -c \"ALTER SYSTEM SET wal_level = logical;\"" && \
make down-services up-services
delete:
devbox run "dropdb -p 5434 bemi_dev_source && dropuser -p 5434 postgres"
install:
devbox run --env-file ./.env "bundle install"
up: install
devbox run --env-file ./.env "bin/rails server"
up-services:
devbox services start postgresql-source
down-services:
devbox services stop
ps:
@devbox services ls
sh:
devbox --env-file ./.env shell
psql:
devbox run psql bemi_dev_source -p 5434
logs:
tail -f .devbox/virtenv/postgresql/data/log/postgresql-*.log
migrate:
devbox run --env-file ./.env "bin/rails db:migrate"
rollback:
devbox run --env-file ./.env "bin/rails db:rollback"
console:
devbox run --env-file ./.env "bin/rails console"