-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
73 lines (55 loc) · 2.44 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
LUAJIT ?= /usr/local/openresty/luajit/bin/luajit
.PHONY: annotate_modes schema.sql init_schema test screenshot test_db prod_db migrate linit checkpoint restore_checkpoint devdb count vendor install_dependencies
test:
busted
tags::
moon-tags --lapis $$(git ls-files models/ applications/ helpers/ app.moon) > $@
pin_dependencies:
luarocks --lua-version=5.1 --local build --only-deps --pin
install_dependencies:
luarocks --lua-version=5.1 --local build --only-deps
migrate:
lapis migrate
make schema.sql
assetspec.Tupfile::
lapis-eswidget generate_spec --esbuild-args='--external:/static/*' --tup-compile-dep-group='$$(TOP)/<moon>' --tup-bundle-dep-group='$$(TOP)/<coffee>' --source-dir=static/coffee --format tup > assetspec.Tupfile
schema.sql:
pg_dump -s -U postgres streakclub > schema.sql
pg_dump -a -t lapis_migrations -U postgres streakclub >> schema.sql
init_schema:
createdb -U postgres streakclub
cat schema.sql | psql -U postgres streakclub
screenshot:
busted -o spec/screenshot_handler.lua
test_db:
-dropdb -U postgres streakclub_test
createdb -U postgres streakclub_test
pg_dump -s -U postgres streakclub | psql -U postgres streakclub_test
pg_dump -a -t lapis_migrations -U postgres streakclub | psql -U postgres streakclub_test
prod_db:
-dropdb -U postgres streakclub_prod
createdb -U postgres streakclub_prod
pg_restore -U postgres -d streakclub_prod $$(find /mnt/drive/site-backups/ | grep streakclub | sort -V | tail -n 1)
lint:
git ls-files | grep '\.moon$$' | grep -v config.moon | grep -v spec/ | xargs -n 100 moonc -l
checkpoint:
mkdir -p dev_backup
pg_dump -F c -U postgres streakclub > dev_backup/$$(date +%F_%H-%M-%S).dump
restore_checkpoint:
-dropdb -U postgres streakclub
createdb -U postgres streakclub
pg_restore -U postgres -d streakclub $$(find dev_backup | grep \.dump | sort -V | tail -n 1)
annotate_models:
lapis annotate $$(find models -type f | grep moon$$)
count:
wc -l $$(git ls-files | grep 'scss$$\|moon$$\|coffee$$\|md$$\|conf$$') | sort -n | tail
# copy all the node modules
vendor:
npm install
cp node_modules/jquery/dist/jquery.min.js static/lib
cp node_modules/jstz/dist/jstz.min.js static/lib
cp node_modules/typed.js/lib/typed.min.js static/lib
cp node_modules/commonmark/dist/commonmark.min.js static/markdown/
cp node_modules/turndown/dist/turndown.js static/markdown/
cp node_modules/selectize/dist/js/standalone/selectize.min.js static/lib
cp node_modules/selectize/dist/css/selectize.css static/lib