-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (26 loc) · 910 Bytes
/
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
.PHONY: test migrate init_schema test_db lint checkpoint annotate_models
test:
busted
migrate:
lapis migrate
make schema.sql
schema.sql::
pg_dump -s -U postgres ludumdare > schema.sql
pg_dump -a -t lapis_migrations -U postgres ludumdare >> schema.sql
init_schema:
createdb -U postgres ludumdare
cat schema.sql | psql -U postgres ludumdare
test_db:
-dropdb -U postgres ludumdare_test
createdb -U postgres ludumdare_test
pg_dump -s -U postgres ludumdare | psql -U postgres ludumdare_test
pg_dump -a -t lapis_migrations -U postgres ludumdare | psql -U postgres ludumdare_test
lint:
git ls-files | grep '\.moon$$' | grep -v config.moon | xargs -n 100 moonc -l
checkpoint:
mkdir -p dev_backup
pg_dump -F c -U postgres ludumdare > dev_backup/$$(date +%F_%H-%M-%S).dump
annotate_models:
lapis annotate $$(find models -type f | grep moon$$)
dump.sql::
pg_dump -U postgres ludumdare > dump.sql