diff --git a/.env.sample b/.env.sample new file mode 100644 index 00000000..c2d47cb7 --- /dev/null +++ b/.env.sample @@ -0,0 +1,8 @@ +SF_ACCOUNT=vna27887.us-east-1 +SF_USERNAME= +SF_PASSWORD= +SF_REGION=us-east-1 +SF_DATABASE=POLYGON_COMMUNITY_DEV +SF_WAREHOUSE=FLIPSIDE_COMMUNITY_CURATOR +SF_ROLE=FLIPSIDE_COMMUNITY_CURATOR +SF_SCHEMA=SILVER diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..4e8b7612 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dbt-labs/dbt-snowflake:1.2.latest +WORKDIR /support +RUN mkdir /root/.dbt +COPY profiles.yml /root/.dbt +RUN mkdir /root/flow +WORKDIR /flow +COPY . . +EXPOSE 8080 +ENTRYPOINT [ "bash"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..204298e0 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +SHELL := /bin/bash + +dbt-console: + docker-compose run dbt_console + +.PHONY: dbt-console diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..0dc69655 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.4" + +services: + dbt_console: + build: . + volumes: + - .:/polygon + env_file: + - .env diff --git a/macros/run_sp_create_prod_community_clone.sql b/macros/run_sp_create_prod_community_clone.sql new file mode 100644 index 00000000..5bf2ef63 --- /dev/null +++ b/macros/run_sp_create_prod_community_clone.sql @@ -0,0 +1,7 @@ +{% macro run_sp_create_prod_community_clone() %} +{% set clone_query %} +call polygon._internal.create_prod_clone('polygon', 'polygon_community_dev', 'flipside_community_curator'); +{% endset %} + +{% do run_query(clone_query) %} +{% endmacro %} diff --git a/profiles.yml b/profiles.yml index 2a6c6b4e..36b44a14 100644 --- a/profiles.yml +++ b/profiles.yml @@ -26,4 +26,18 @@ polygon: schema: "{{ env_var('SCHEMA') }}" threads: 4 client_session_keep_alive: False - query_tag: polygon_curator \ No newline at end of file + query_tag: polygon_curator + community_dev: + type: snowflake + account: "{{ env_var('SF_ACCOUNT') }}" + # User/password auth + user: "{{ env_var('SF_USERNAME') }}" + password: "{{ env_var('SF_PASSWORD') }}" + role: "{{ env_var('SF_ROLE') }}" + schema: "{{ env_var('SF_SCHEMA') }}" + region: "{{ env_var('SF_REGION') }}" + database: "{{ env_var('SF_DATABASE') }}" + warehouse: "{{ env_var('SF_WAREHOUSE') }}" + threads: 4 + client_session_keep_alive: False + query_tag: polygon_curator