forked from pgsty/extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (24 loc) · 981 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
#==============================================================#
# File : Makefile
# Ctime : 2024-10-30
# Desc : Makefile shortcuts
# Path : Makefile
# Copyright (C) 2019-2020 Ruohang Feng
#==============================================================#
default: run
PGURL="postgres:///vonng"
# run http server to serve the docs
run:
docs/run
# update docs from the data/pigsty.csv
gen:
bin/tabulate.py
all: dump gen run
dump: save
save:
psql $(PGURL) -c "COPY (SELECT * FROM ext.pigsty ORDER BY id) TO '/Users/vonng/pgsty/extension/data/pigsty.csv' CSV HEADER;"
save-mini:
psql $(PGURL) -c "COPY (select id,name,alias,category,lead,rpm_repo,rpm_pkg,rpm_pg,deb_repo,deb_pkg,deb_pg FROM ext.pigsty ORDER BY id) TO '/Users/vonng/pgsty/extension/data/extension.csv' CSV HEADER;"
load:
psql $(PGURL) -c "TRUNCATE ext.pigsty; COPY ext.pigsty FROM '/Users/vonng/pgsty/extension/data/pigsty.csv' CSV HEADER;"
.PHONY: default run gen dump save load