Skip to content

Commit

Permalink
parameterizing the basics Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-tmathew committed May 6, 2024
1 parent d346f49 commit 151ea37
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/dev-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,20 @@ jobs:
# snow --config-file config.toml connection set-default "myconnection"
- name: Test Basic Schemachange
env:
MY_TARGET_SCHEMA: BASICS_DEMO_${{ env.SCHEMACHANGE_BUILD_ID }}
SCENARIO_NAME: basics_demo
run: |
echo "Setting up ${MY_TARGET_SCHEMA}"
schemachange --config-folder ./demo/setup/basics_demo
export MY_TARGET_SCHEMA="${SCENARIO_NAME}_${{ env.SCHEMACHANGE_BUILD_ID }}"
echo "::group::Setting up ${MY_TARGET_SCHEMA}"
schemachange --config-folder ./demo/setup/${SCENARIO_NAME}
echo "::endgroup::"
echo "Testing Rendering to ${MY_TARGET_SCHEMA}"
echo "Work in Progress"
echo "Testing Deployment using ${MY_TARGET_SCHEMA}"
schemachange --config-folder ./demo/basics
echo "Tearing down up ${MY_TARGET_SCHEMA}"
schemachange --config-folder ./demo/teardown/basics_demo
echo "Work in Progress - To be Tested"
echo "::group::Testing Deployment using ${MY_TARGET_SCHEMA}"
schemachange --config-folder ./demo/${SCENARIO_NAME}
echo "::endgroup::"
echo "::group::Tearing down up ${MY_TARGET_SCHEMA}"
schemachange --config-folder ./demo/teardown/${SCENARIO_NAME}
echo "::endgroup::"
#- name: Test Citibike Demo
# run: |
# snow --config-file config.toml sql -f ./demo/setup/setup_citibike_demo.sql
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 1

root-folder: ./demo/basics
root-folder: ./demo/{{ env_var('SCENARIO_NAME')}}

snowflake-user: {{ env_var('SNOWFLAKE_USER')}}
snowflake-account: {{ env_var('SNOWFLAKE_ACCOUNT')}}
Expand Down
5 changes: 3 additions & 2 deletions demo/setup/basics_demo/schemachange-config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
config-version: 1

root-folder: ./demo/setup/basics_demo
root-folder: ./demo/setup/{{ env_var('SCENARIO_NAME')}}

snowflake-user: {{ env_var('SNOWFLAKE_USER')}}
snowflake-account: {{ env_var('SNOWFLAKE_ACCOUNT')}}
snowflake-role: {{ env_var('SNOWFLAKE_ROLE')}}
snowflake-warehouse: {{ env_var('SNOWFLAKE_WAREHOUSE')}}
snowflake-database: {{ env_var('SNOWFLAKE_DATABASE')}}
change-history-table: "{{ env_var('SNOWFLAKE_DATABASE')}}.SCHEMACHANGE.BASICS_DEMO_CHANGE_HISTORY"
# tracking the setup step in a different change history table to use schemachange setup and teardown separate from deployment.
change-history-table: "{{ env_var('SNOWFLAKE_DATABASE')}}.SCHEMACHANGE.{{ env_var('SCENARIO_NAME')}}_CHANGE_HISTORY"
create-change-history-table: true

vars:
Expand Down
5 changes: 3 additions & 2 deletions demo/teardown/basics_demo/schemachange-config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
config-version: 1

root-folder: ./demo/teardown/basics_demo
root-folder: ./demo/teardown/{{ env_var('SCENARIO_NAME')}}

snowflake-user: {{ env_var('SNOWFLAKE_USER')}}
snowflake-account: {{ env_var('SNOWFLAKE_ACCOUNT')}}
snowflake-role: {{ env_var('SNOWFLAKE_ROLE')}}
snowflake-warehouse: {{ env_var('SNOWFLAKE_WAREHOUSE')}}
snowflake-database: {{ env_var('SNOWFLAKE_DATABASE')}}
change-history-table: "{{ env_var('SNOWFLAKE_DATABASE')}}.SCHEMACHANGE.BASICS_DEMO_CHANGE_HISTORY"
# tracking the setup step in a different change history table to use schemachange setup and teardown separate from deployment.
change-history-table: "{{ env_var('SNOWFLAKE_DATABASE')}}.SCHEMACHANGE.{{ env_var('SCENARIO_NAME')}}_CHANGE_HISTORY"
create-change-history-table: true

vars:
Expand Down

0 comments on commit 151ea37

Please sign in to comment.