feat: adjust makefile
This commit is contained in:
parent
7ce7e98a1e
commit
b96accf9bf
3
makefile
3
makefile
|
@ -12,6 +12,9 @@ psql = $(strip psql -v schema=$(SCHEMA))
|
||||||
load: $(addprefix load-,$(TABLES))
|
load: $(addprefix load-,$(TABLES))
|
||||||
@$(psql) -t -A -c "SELECT FORMAT('* loaded %s', feed_file) WHERE feed_file = '$(GTFS)';"
|
@$(psql) -t -A -c "SELECT FORMAT('* loaded %s', feed_file) WHERE feed_file = '$(GTFS)';"
|
||||||
|
|
||||||
|
copy: $(ZHV)
|
||||||
|
$(psql) -c "\copy stops(stop_seq_no,stop_type,stop_dhid,stop_parent,stop_name,stop_lat,stop_lon,stop_municipality_code,stop_municipality,stop_district_code,stop_district,stop_condition,stop_state,stop_description,stop_authority,stop_delfi_name,stop_tariff_dhid,stop_tariff_name) FROM '$<' DELIMITER ',' CSV HEADER;"
|
||||||
|
|
||||||
# -v: variable assignment, like the /set meta-command
|
# -v: variable assignment, like the /set meta-command
|
||||||
# $<: name of the firest prerequisite
|
# $<: name of the firest prerequisite
|
||||||
init: sql/schema.sql
|
init: sql/schema.sql
|
||||||
|
|
15
readme.md
15
readme.md
|
@ -5,7 +5,14 @@
|
||||||
cd ~
|
cd ~
|
||||||
mkdir ~/git && cd ~/git
|
mkdir ~/git && cd ~/git
|
||||||
git clone https://git.wtf-eg.de/dancesWithCycles/zhv.git
|
git clone https://git.wtf-eg.de/dancesWithCycles/zhv.git
|
||||||
cd zhv
|
cd ~/git/zhv
|
||||||
|
```
|
||||||
|
|
||||||
|
* configure cron
|
||||||
|
```
|
||||||
|
cat dload/crontab
|
||||||
|
crontab -e
|
||||||
|
crontab -l
|
||||||
```
|
```
|
||||||
|
|
||||||
* make sure to set variables like `PGDATABASE`, `PGUSER`, `PGHOST`, `PGPORT` aaso. appropriately
|
* make sure to set variables like `PGDATABASE`, `PGUSER`, `PGHOST`, `PGPORT` aaso. appropriately
|
||||||
|
@ -15,3 +22,9 @@ cd zhv
|
||||||
```
|
```
|
||||||
make init
|
make init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* load database
|
||||||
|
|
||||||
|
```
|
||||||
|
cd ~/git/zhv
|
||||||
|
make load GTFS=<zip file>
|
Loading…
Reference in New Issue