-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.86 KB
/
Makefile
File metadata and controls
54 lines (40 loc) · 1.86 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
include .env
export
DBT_FOLDER := transform
TARGET ?= dev
DBT_PROFILE_DIR := ./
PROFILE ?= transform
## Development
install:
uv sync --dev
format:
uv run ruff format .
debug:
cd $(DBT_FOLDER) && dbt debug --target $(TARGET) --profile $(PROFILE) --profiles-dir $(DBT_PROFILE_DIR)
run:
@echo "transform_path_output: $(TRANSFORM_S3_PATH_OUTPUT)"
cd $(DBT_FOLDER) && dbt run \
--profiles-dir $(DBT_PROFILE_DIR) \
--target $(TARGET) \
--profile $(PROFILE) \
--vars '{"TRANSFORM_S3_PATH_OUTPUT": "$(TRANSFORM_S3_PATH_OUTPUT)", "TRANSFORM_S3_PATH_INPUT_EXCEL":"$(TRANSFORM_S3_PATH_INPUT_EXCEL)" }'
test:
cd $(DBT_FOLDER) && dbt test --target $(TARGET) --profile $(PROFILE) --profiles-dir $(DBT_PROFILE_DIR)
build:
cd $(DBT_FOLDER) && dbt build --target $(TARGET) --profile $(PROFILE) --profiles-dir $(DBT_PROFILE_DIR) \
--vars '{"TRANSFORM_S3_PATH_OUTPUT": "$(TRANSFORM_S3_PATH_OUTPUT)", "TRANSFORM_S3_PATH_INPUT_EXCEL":"$(TRANSFORM_S3_PATH_INPUT_EXCEL)" }'
select:
cd $(DBT_FOLDER) && dbt run --select path:models/marts/orders/dim_aeroplane.sql --target $(TARGET) --profile $(PROFILE) --profiles-dir $(DBT_PROFILE_DIR) \
--vars '{"TRANSFORM_S3_PATH_OUTPUT": "$(TRANSFORM_S3_PATH_OUTPUT)", "TRANSFORM_S3_PATH_INPUT_EXCEL":"$(TRANSFORM_S3_PATH_INPUT_EXCEL)" }'
.PHONY: docs
docs: build
uv pip install -r requirements.txt
cd $(DBT_FOLDER) && dbt docs generate --target $(TARGET) --profile $(PROFILE) --profiles-dir $(DBT_PROFILE_DIR)
@echo "Starting documentation on http://localhost:8089"
cd $(DBT_FOLDER) && dbt docs serve --port 8089
clean:
cd $(DBT_FOLDER) && dbt clean --target $(TARGET) --profile $(PROFILE) --profiles-dir $(DBT_PROFILE_DIR)
duck_dev:
cd $(DBT_FOLDER) && duckdb duckdb_dir/transform_dev.db -cmd "USE transform; show all tables"
duck_prod:
cd $(DBT_FOLDER) && duckdb duckdb_dir/transform_prod.db -cmd "USE transform; show all tables"