-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from fivetran/MagicBot/dbt-utils-cross-db-migr…
…ation Updates for dbt-utils to dbt-core cross-db macro migration
- Loading branch information
Showing
19 changed files
with
309 additions
and
202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Export secrets for Docker containers. | ||
# Restrict exposing secrets only to the steps that need them | ||
export GCLOUD_SERVICE_KEY=$(gcloud secrets versions access latest --secret="GCLOUD_SERVICE_KEY" --project="dbt-package-testing-363917") | ||
export CI_POSTGRES_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_HOST" --project="dbt-package-testing-363917") | ||
export CI_POSTGRES_DBT_USER=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_USER" --project="dbt-package-testing-363917") | ||
export CI_POSTGRES_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_PASS" --project="dbt-package-testing-363917") | ||
export CI_POSTGRES_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_DBNAME" --project="dbt-package-testing-363917") | ||
export CI_REDSHIFT_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_DBNAME" --project="dbt-package-testing-363917") | ||
export CI_REDSHIFT_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_HOST" --project="dbt-package-testing-363917") | ||
export CI_REDSHIFT_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_PASS" --project="dbt-package-testing-363917") | ||
export CI_REDSHIFT_DBT_USER=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_USER" --project="dbt-package-testing-363917") | ||
export CI_SNOWFLAKE_DBT_ACCOUNT=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ACCOUNT" --project="dbt-package-testing-363917") | ||
export CI_SNOWFLAKE_DBT_DATABASE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_DATABASE" --project="dbt-package-testing-363917") | ||
export CI_SNOWFLAKE_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_PASS" --project="dbt-package-testing-363917") | ||
export CI_SNOWFLAKE_DBT_ROLE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ROLE" --project="dbt-package-testing-363917") | ||
export CI_SNOWFLAKE_DBT_USER=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_USER" --project="dbt-package-testing-363917") | ||
export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_WAREHOUSE" --project="dbt-package-testing-363917") | ||
export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917") | ||
export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917") | ||
export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917") |
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,59 @@ | ||
steps: | ||
- label: ":postgres: Run Tests - Postgres" | ||
key: "run-dbt-postgres" | ||
plugins: | ||
- docker#v3.13.0: | ||
image: "python:3.8" | ||
shell: [ "/bin/bash", "-e", "-c" ] | ||
environment: | ||
- "BASH_ENV=/tmp/.bashrc" | ||
- "CI_POSTGRES_DBT_DBNAME" | ||
- "CI_POSTGRES_DBT_HOST" | ||
- "CI_POSTGRES_DBT_PASS" | ||
- "CI_POSTGRES_DBT_USER" | ||
commands: | | ||
bash .buildkite/scripts/run_models.sh postgres | ||
- label: ":snowflake-db: Run Tests - Snowflake" | ||
key: "run_dbt_snowflake" | ||
plugins: | ||
- docker#v3.13.0: | ||
image: "python:3.8" | ||
shell: [ "/bin/bash", "-e", "-c" ] | ||
environment: | ||
- "BASH_ENV=/tmp/.bashrc" | ||
- "CI_SNOWFLAKE_DBT_ACCOUNT" | ||
- "CI_SNOWFLAKE_DBT_DATABASE" | ||
- "CI_SNOWFLAKE_DBT_PASS" | ||
- "CI_SNOWFLAKE_DBT_ROLE" | ||
- "CI_SNOWFLAKE_DBT_USER" | ||
- "CI_SNOWFLAKE_DBT_WAREHOUSE" | ||
commands: | | ||
bash .buildkite/scripts/run_models.sh snowflake | ||
- label: ":gcloud: Run Tests - BigQuery" | ||
key: "run_dbt_bigquery" | ||
plugins: | ||
- docker#v3.13.0: | ||
image: "python:3.8" | ||
shell: [ "/bin/bash", "-e", "-c" ] | ||
environment: | ||
- "BASH_ENV=/tmp/.bashrc" | ||
- "GCLOUD_SERVICE_KEY" | ||
commands: | | ||
bash .buildkite/scripts/run_models.sh bigquery | ||
- label: ":amazon-redshift: Run Tests - Redshift" | ||
key: "run_dbt_redshift" | ||
plugins: | ||
- docker#v3.13.0: | ||
image: "python:3.8" | ||
shell: [ "/bin/bash", "-e", "-c" ] | ||
environment: | ||
- "BASH_ENV=/tmp/.bashrc" | ||
- "CI_REDSHIFT_DBT_DBNAME" | ||
- "CI_REDSHIFT_DBT_HOST" | ||
- "CI_REDSHIFT_DBT_PASS" | ||
- "CI_REDSHIFT_DBT_USER" | ||
commands: | | ||
bash .buildkite/scripts/run_models.sh redshift |
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,25 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
apt-get update | ||
apt-get install libsasl2-dev | ||
|
||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install --upgrade pip setuptools | ||
pip install -r integration_tests/requirements.txt | ||
mkdir -p ~/.dbt | ||
cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml | ||
|
||
db=$1 | ||
echo `pwd` | ||
cd integration_tests | ||
dbt deps | ||
dbt seed --target "$db" --full-refresh | ||
dbt run --target "$db" --full-refresh | ||
dbt test --target "$db" | ||
dbt run --vars '{xero__using_credit_note: false, xero__using_bank_transaction: false}' --target "$db" --full-refresh | ||
dbt test --target "$db" | ||
dbt run --target "$db" --full-refresh | ||
dbt test --target "$db" |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.