-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 1.42 KB
/
Copy pathMakefile
File metadata and controls
34 lines (25 loc) · 1.42 KB
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
pupa-dbinit: export OCD_DIVISION_CSV=../country-ca-toronto.csv
pupa-dbinit: ## Reset/initiate the database
cd scrapers && pupa dbinit --reset ca
pupa-update: export OCD_DIVISION_CSV=../country-ca-toronto.csv
pupa-update: ## Runs `pupa update ca_on_toronto`
cd scrapers && pupa update ca_on_toronto $(filter-out $@,$(MAKECMDGOALS))
pupa-update-fast: export OCD_DIVISION_CSV=../country-ca-toronto.csv
pupa-update-fast: ## Runs `pupa update ca_on_toronto` without rate-limits (only use when cached)
cd scrapers && pupa update --fastmode ca_on_toronto $(filter-out $@,$(MAKECMDGOALS))
pupa-update-events: export OCD_DIVISION_CSV=../country-ca-toronto.csv
pupa-update-events: ## Runs `pupa update ca_on_toronto events-full`
cd scrapers && pupa update ca_on_toronto events-full
weekly-pupa-update-events: export OCD_DIVISION_CSV=../country-ca-toronto.csv
weekly-pupa-update-events: ## Runs `pupa update ca_on_toronto events-full` only on Sunday
ifeq ($(shell date +%A ), Sunday)
cd scrapers && pupa update ca_on_toronto events-full
endif
mark-cancelled-events: pupa-update-events ## Mark non-updated events (+1hr) as cancelled
psql $(DATABASE_URL) -c "UPDATE opencivicdata_event SET status='cancelled' WHERE (updated_at < current_timestamp - interval '30' minute)"
%:
@true
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help