diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..5741f14 --- /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=AVALANCHE_COMMUNITY_DEV +SF_WAREHOUSE=FLIPSIDE_COMMUNITY_CURATOR +SF_ROLE=FLIPSIDE_COMMUNITY_CURATOR +SF_SCHEMA=SILVER \ No newline at end of file diff --git a/.gitignore b/.gitignore index fec6df8..d2045f4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ logs/ .history/ **/.DS_Store .vscode/ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70cd133 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM fishtownanalytics/dbt:1.0.0 +WORKDIR /support +RUN mkdir /root/.dbt +COPY profiles.yml /root/.dbt +RUN mkdir /root/avalanche +WORKDIR /avalanche +COPY . . +EXPOSE 8080 +ENTRYPOINT [ "bash"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2a695b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +SHELL := /bin/bash + +dbt-console: + docker-compose run dbt_console + +.PHONY: dbt-console \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b08ce9c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.4" + +services: + dbt_console: + build: . + volumes: + - .:/avalanche + 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 0000000..daac521 --- /dev/null +++ b/macros/run_sp_create_prod_community_clone.sql @@ -0,0 +1,10 @@ +{% macro run_sp_create_prod_community_clone() %} + {% set clone_query %} + call avalanche._internal.create_prod_clone( + 'avalanche', + 'avalanche_community_dev', + 'flipside_community_curator' + ); + {% endset %} + {% do run_query(clone_query) %} +{% endmacro %} diff --git a/profiles.yml b/profiles.yml new file mode 100644 index 0000000..ed0c914 --- /dev/null +++ b/profiles.yml @@ -0,0 +1,19 @@ +avalanche: + target: dev + outputs: + 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: avalanche_curator + config: + send_anonymous_usage_stats: False \ No newline at end of file