-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (25 loc) · 1.02 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
.PHONY: all extract validate transform build check publish clean
include config.mk
EXT = html
RESOURCE_NAMES := $(shell $(PYTHON) main.py resources)
OUTPUT_FILES := $(addsuffix .csv,$(addprefix data/,$(RESOURCE_NAMES)))
all: extract validate transform build check
extract:
$(foreach resource_name, $(RESOURCE_NAMES),$(PYTHON) main.py extract $(resource_name) &&) true
validate:
frictionless validate datapackage.yaml
transform: $(OUTPUT_FILES)
$(OUTPUT_FILES): data/%.csv: data-raw/%.$(EXT) schemas/%.yaml scripts/transform.py datapackage.yaml
$(PYTHON) main.py transform $*
build: transform datapackage.json
datapackage.json: $(OUTPUT_FILES) scripts/build.py datapackage.yaml
$(PYTHON) main.py build
check:
frictionless validate datapackage.json
publish:
git add -Af datapackage.json data/*.csv data-raw/*.$(EXT)
git commit --author="Automated <actions@users.noreply.github.com>" -m "Update data package at: $$(date +%Y-%m-%dT%H:%M:%SZ)" || exit 0
git push
variables:
@echo $(RESOURCE_NAMES)
@echo $(OUTPUT_FILES)