forked from gouline/dbt-metabase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
109 lines (88 loc) · 2.26 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
build: clean
python3 -m build
.PHONY: build
clean:
rm -rf build dist
.PHONY: clean
requirements:
python3 -m pip install \
-r requirements.txt \
-r requirements-test.txt
.PHONY: requirements
fix-fmt:
black .
.PHONY: fix-fmt
fix-imports:
isort .
.PHONY: fix-imports
fix: fix-fmt fix-imports
.PHONY: fix
check-fmt:
black --check .
.PHONY: check-fmt
check-imports:
isort --check .
.PHONY: check-imports
check-lint-python:
pylint dbtmetabase
.PHONY: check-lint-python
check-type:
mypy dbtmetabase
.PHONY: check-type
check: check-fmt check-imports check-lint-python check-type
.PHONY: check
test:
python3 -m unittest tests
.PHONY: test
pre: fix check test
.PHONY: pre
dist-check: build
twine check dist/*
.PHONY: dist-check
dist-upload: check
twine upload dist/*
.PHONY: dist-upload
install: build
python3 -m pip uninstall -y dbt-metabase \
&& python3 -m pip install dist/dbt_metabase-*-py3-none-any.whl
.PHONY: install
sandbox-up:
( cd sandbox && docker-compose up --build --attach app )
.PHONY: sandbox-up
sandbox-down:
( cd sandbox && docker-compose down )
.PHONY: sandbox-up
sandbox-models:
( source sandbox/.env && python3 -m dbtmetabase models \
--manifest-path sandbox/target/manifest.json \
--metabase-url http://localhost:$$MB_PORT \
--metabase-username $$MB_USER \
--metabase-password $$MB_PASSWORD \
--metabase-database $$POSTGRES_DB \
--include-schemas "pub*",other \
--http-header x-dummy-key dummy-value \
--order-fields \
--verbose )
.PHONY: sandbox-models
sandbox-exposures:
rm -rf sandbox/models/exposures
mkdir -p sandbox/models/exposures
( source sandbox/.env && python3 -m dbtmetabase exposures \
--manifest-path sandbox/target/manifest.json \
--metabase-url http://localhost:$$MB_PORT \
--metabase-username $$MB_USER \
--metabase-password $$MB_PASSWORD \
--output-path sandbox/models/exposures \
--output-grouping collection \
--verbose )
( source sandbox/.env && cd sandbox && \
POSTGRES_HOST=localhost \
POSTGRES_PORT=$$POSTGRES_PORT \
POSTGRES_USER=$$POSTGRES_USER \
POSTGRES_PASSWORD=$$POSTGRES_PASSWORD \
POSTGRES_DB=$$POSTGRES_DB \
POSTGRES_SCHEMA=$$POSTGRES_SCHEMA \
dbt docs generate )
.PHONY: sandbox-exposures
sandbox-e2e: sandbox-up sandbox-models sandbox-exposures sandbox-down
.PHONY: sandbox-e2e