-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
179 lines (145 loc) · 4.46 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
ifneq (,$(wildcard ./.env))
include .env
export
endif
.Phony: start
start:
deno run -A tal.ts "ripienaar/free-for-dev"
.Phony: startall
startall:
deno run -A tal.ts
.Phony: build
build:
deno run -A tal.ts --html --no-serve
.Phony: prod-start
prod-start:
FORCE=1 PROD=1 deno run -A tal.ts ${args}
.Phony: prod-builddemo
prod-builddemo:
FORCE=1 PROD=1 deno run -A tal.ts --no-fetch --html ripienaar/free-for-dev ${args}
.Phony: prod-buildindex
prod-buildindex:
PROD=1 deno run -A tal.ts --no-fetch --html ripienaar/free-for-dev
.Phony: prod-buildsource
prod-buildsource:
FORCE=1 PROD=1 deno run -A tal.ts --no-fetch --html ${source}
.Phony: prod-build
prod-build:
PROD=1 deno run -A tal.ts --html --no-serve ${args} && make prod-buildsearch
.Phony: prod-run
prod-run:
FORCE=1 PROD=1 deno run -A tal.ts --html ${args}
.Phony: startsource
startsource:
deno run -A tal.ts --html ${source}
.Phony: prod-startsource
prod-startsource:
PROD=1 deno run -A tal.ts ${source}
.Phony: all
all:
FORCE=1 deno run -A tal.ts --html "ripienaar/free-for-dev"
.Phony: allall
allall:
FORCE=1 deno run -A tal.ts --html
.Phony: startallforce
startallforce:
deno run -A tal.ts --force
.Phony: fetch
fetch:
deno run -A tal.ts --no-markdown --no-serve "ripienaar/free-for-dev" --force
.Phony: fetchall
fetchall:
deno run -A tal.ts --no-markdown --no-serve
.Phony: fetchsource
fetchsource:
deno run -A tal.ts --no-markdown --no-serve ${source}
.Phony: buildmarkdown
buildmarkdown:
FORCE=1 deno run -A tal.ts --no-fetch --no-serve "ripienaar/free-for-dev"
.Phony: buildsource
buildsource:
FORCE=1 deno run -A tal.ts --no-serve --no-fetch ${source}
.Phony: buildmarkdownall
buildmarkdownall:
FORCE=1 deno run -A tal.ts --no-fetch --no-serve
.Phony: serve
serve:
deno run -A --watch=tal.ts,templates/ tal.ts --no-fetch --no-markdown
.Phony: run
run:
LIMIT=3 FORCE=1 deno run -A tal.ts --no-fetch --html
.Phony: siteall
siteall:
FORCE=1 deno run -A tal.ts --no-fetch --html
.Phony: initdb
initdb:
[[ ! -d /db/meta.json ]] && mkdir -p ./db && cat db-meta-init.json > ./db/meta.json && deno run -A init-db.ts
.Phony: prod-initdb
prod-initdb:
[[ ! -d /prod-db/meta.json ]] && mkdir -p ./prod-db && cat db-meta-init.json > ./prod-db/meta.json && PROD=1 deno run -A init-db.ts
.Phony: clean
clean:
rm -rf ./db rm -rf ./public && rm -rf ./dist && make initdb
.Phony: cleanall
cleanall:
rm -rf ./db rm -rf ./public && rm -rf ./dist && rm -rf ./prod-db && rm -rf ./prod-dist && rm -rf ./prod-public && make initdb && make prod-initdb
.Phony: push
push:
cd -- ./dist/repo && git add . && git commit -m "update" && git push
.Phony: testbooks
testbooks:
deno test -A parsers/markdownlist_test.ts --filter="#2"
.Phony: buildsite
buildsite:
FORCE=1 deno run -A tal.ts --no-fetch --html "ripienaar/free-for-dev"
.Phony: buildsitesource
buildsitesource:
FORCE=1 deno run -A tal.ts --no-fetch --html ${source}
.Phony: buildsiteall
buildsiteall:
FORCE=1 deno run -A tal.ts --no-fetch --html
.Phony: prod-buildsiteall
prod-buildsiteall:
PROD=1 deno run -A tal.ts --no-fetch --html --no-serve
.Phony: buildhtmlall
buildhtmlall:
deno run -A tal.ts --no-fetch --no-markdown --html --no-serve
.Phony: servepublic
servepublic:
deno run -A https://deno.land/[email protected]/http/file_server.ts ./public -p 8000
.Phony: install
install:
./scripts/install-morsels.sh
.Phony: servebook
servebook:
./bin/mdbook serve --port 8000
.Phony: buildbook
buildbook:
./bin/mdbook build
.Phony: publish
publish:
wrangler pages publish db/public --project-name trackawesomelist
.Phony: prod-publish
prod-publish:
wrangler pages publish prod-db/public --project-name trackawesomelist
.Phony: prod-upload
prod-upload:
make prod-zipdb && aws s3 cp ./prod-db.zip s3://trackawesomelist/prod-db.zip --endpoint-url $(AWS_ENDPOINT)
.Phony: prod-load
prod-load:
aws s3 cp s3://trackawesomelist/prod-db.zip ./prod-db.zip --endpoint-url $(AWS_ENDPOINT) && make prod-unzipdb
.Phony: prod-zipdb
prod-zipdb:
zip -r -q -FS prod-db.zip ./prod-db -x "*/.*"
.Phony: prod-unzipdb
prod-unzipdb:
unzip -q -o prod-db.zip
.Phony: prod-dbclean
prod-dbclean:
rm -rf ./prod-db/public && rm -rf ./prod-db/repos && rm ./prod-db/index.json && rm ./prod-db/meta.json && make prod-initdb
.Phony: buildsearch
buildsearch:
./bin/morsels ./db/public ./temp-morsels -c morsels_config.json && deno run -A ./build-search.ts
.Phony: prod-buildsearch
prod-buildsearch:
./bin/morsels ./prod-db/public ./temp-morsels -c morsels_config.json && PROD=1 deno run -A ./build-search.ts