-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9b6918
commit 9c012f6
Showing
5 changed files
with
143 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# Script used in github actions to run test the schemachange functionality against the demo scenarios included in the repository. | ||
touch ./connections.toml | ||
echo [default] >> ./connections.toml | ||
echo account = \"${SNOWFLAKE_ACCOUNT}\" >> ./connections.toml | ||
echo user = \"${SNOWFLAKE_USER}\" >> ./connections.toml | ||
echo role = \"${SNOWFLAKE_ROLE}\" >> ./connections.toml | ||
echo warehouse = \"${SNOWFLAKE_WAREHOUSE}\" >> ./connections.toml | ||
echo database = \"${SNOWFLAKE_DATABASE}\" >> ./connections.toml | ||
echo password = \"${SNOWFLAKE_PASSWORD}\" >> ./connections.toml | ||
echo "cat connections.toml" | ||
cat ./connections.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
# Script used in github actions to run test the schemachange functionality against the demo scenarios included in the repository. | ||
echo "::group::Setting up ${MY_TARGET_SCHEMA}" | ||
schemachange deploy \ | ||
--config-folder ./demo \ | ||
--config-file-name schemachange-config-setup.yml \ | ||
--root-folder ./demo/${SCENARIO_NAME}/1_setup \ | ||
--connection-name default \ | ||
--connections-file-path ./connections.toml \ | ||
--verbose | ||
echo "::endgroup::" | ||
|
||
echo "::group::Testing Rendering to ${MY_TARGET_SCHEMA}" | ||
|
||
schemachange render \ | ||
--config-folder ./demo/${SCENARIO_NAME} \ | ||
./demo/${SCENARIO_NAME}/2_test/A__render.sql | ||
schemachange render \ | ||
--config-folder ./demo/${SCENARIO_NAME} \ | ||
./demo/${SCENARIO_NAME}/2_test/R__render.sql | ||
schemachange render \ | ||
--config-folder ./demo/${SCENARIO_NAME} \ | ||
./demo/${SCENARIO_NAME}/2_test/V1.0.0__render.sql | ||
echo "::endgroup::" | ||
|
||
echo "::group::Testing Deployment using ${MY_TARGET_SCHEMA}" | ||
set +e | ||
schemachange deploy \ | ||
--config-folder ./demo/${SCENARIO_NAME} \ | ||
--connection-name default \ | ||
--connections-file-path ./connections.toml \ | ||
--root-folder ./demo/${SCENARIO_NAME}/2_test \ | ||
--verbose | ||
RESULT=$? | ||
|
||
if [ $RESULT -eq 0 ]; then | ||
echo "Deployment Completed!" | ||
else | ||
echo "Deployment Failed. Proceeding to Teardown." | ||
fi | ||
echo "::endgroup::" | ||
|
||
set -e | ||
|
||
echo "::group::Tearing down up ${MY_TARGET_SCHEMA}" | ||
schemachange deploy \ | ||
--config-folder ./demo \ | ||
--config-file-name schemachange-config-teardown.yml \ | ||
--connection-name default \ | ||
--connections-file-path ./connections.toml \ | ||
--root-folder ./demo/${SCENARIO_NAME}/3_teardown \ | ||
--verbose | ||
echo "::endgroup::" | ||
|
||
if [ $RESULT -ne 0 ]; then | ||
exit 1 | ||
fi |