2022-10-17 23:32:28 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
2023-07-18 20:04:21 +00:00
|
|
|
# set default target
|
|
|
|
|
DBT_TARGET ?= sbx
|
2023-07-31 19:54:18 +00:00
|
|
|
AWS_LAMBDA_ROLE ?= aws_lambda_flow_api_sbx
|
2023-07-18 20:04:21 +00:00
|
|
|
|
2022-10-17 23:32:28 +00:00
|
|
|
dbt-console:
|
|
|
|
|
docker-compose run dbt_console
|
|
|
|
|
|
2023-07-18 20:04:21 +00:00
|
|
|
.PHONY: dbt-console
|
|
|
|
|
|
|
|
|
|
sl-flow-api:
|
|
|
|
|
dbt run-operation create_aws_flow_api \
|
|
|
|
|
--profile flow \
|
|
|
|
|
--target $(DBT_TARGET) \
|
|
|
|
|
--profiles-dir ~/.dbt/
|
|
|
|
|
|
|
|
|
|
udfs:
|
2023-07-24 16:24:52 +00:00
|
|
|
dbt run-operation create_udfs \
|
|
|
|
|
--vars '{"UPDATE_UDFS_AND_SPS":True}' \
|
2023-07-18 20:04:21 +00:00
|
|
|
--profile flow \
|
|
|
|
|
--target $(DBT_TARGET) \
|
2023-07-31 19:54:18 +00:00
|
|
|
--profiles-dir ~/.dbt/
|
|
|
|
|
|
2023-08-16 22:57:04 +00:00
|
|
|
complete:
|
|
|
|
|
dbt run \
|
|
|
|
|
--vars '{"STREAMLINE_INVOKE_STREAMS":True, "STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES": True}' \
|
|
|
|
|
-m 1+models/silver/streamline/core/complete \
|
|
|
|
|
--profile flow \
|
|
|
|
|
--target $(DBT_TARGET) \
|
|
|
|
|
--profiles-dir ~/.dbt
|
|
|
|
|
|
|
|
|
|
|
2023-07-31 19:54:18 +00:00
|
|
|
grant-streamline-privileges:
|
|
|
|
|
dbt run-operation grant_streamline_privileges \
|
|
|
|
|
--profile flow \
|
|
|
|
|
--target $(DBT_TARGET) \
|
|
|
|
|
--profiles-dir ~/.dbt/ \
|
|
|
|
|
--args '{role: $(AWS_LAMBDA_ROLE)}'
|
|
|
|
|
|
2023-08-16 22:57:04 +00:00
|
|
|
streamline: sl-flow-api udfs grant-streamline-privileges streamline_bronze
|
|
|
|
|
|
|
|
|
|
streamline_bronze:
|
|
|
|
|
dbt run \
|
2023-08-22 19:01:55 +00:00
|
|
|
--vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES": False}' \
|
2023-08-16 22:57:04 +00:00
|
|
|
-m 1+models/silver/streamline/bronze \
|
|
|
|
|
--profiles-dir ~/.dbt \
|
|
|
|
|
--target $(DBT_TARGET) \
|
|
|
|
|
--profile flow
|