Skip to content

Commit

Permalink
chore: Add VSCode settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo Lares authored and Jo Lares committed Feb 23, 2024
1 parent 55b53b7 commit a4b5f57
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 42 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
- name: Checkout repository code
uses: actions/checkout@v4

- run: sh variable_substitution.sh

- run: sh setup.sh

- run: dbt compile
Expand Down Expand Up @@ -71,8 +69,6 @@ jobs:
- name: Checkout repository code
uses: actions/checkout@v4

- run: sh variable_substitution.sh

- run: sh setup.sh

- run: dbt test
Expand Down Expand Up @@ -112,17 +108,6 @@ jobs:
- name: Checkout repository code
uses: actions/checkout@v4

- run: sh variable_substitution.sh

- run: sh setup.sh

- run: dbt run









4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.defaultInterpreterPath": "${cwd}/.venv/bin/python",
"python.terminal.activateEnvironment": true
}
54 changes: 27 additions & 27 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

##
## Setup runner configuration
## Validate runner configuration variables
##

if [[ -z "${DBT_PROJECT_NAME}" ]]; then
Expand All @@ -19,6 +19,32 @@ if [[ -z "${DBT_WAREHOUSE_PROVIDER}" ]]; then
exit 1
fi

##
## Perform Environment-Specific variable subtitutions
##

if [ "$DBT_WAREHOUSE_PROVIDER" = "snowflake" ]; then
cp dbt_profiles.snowflake.yml profiles.yml

sed -i "s/__SNOWFLAKE_ACCOUNT__/${SNOWFLAKE_ACCOUNT}/g" profiles.yml
sed -i "s/__SNOWFLAKE_DATABASE__/${SNOWFLAKE_DATABASE}/g" profiles.yml
sed -i "s/__SNOWFLAKE_PASSWORD__/${SNOWFLAKE_PASSWORD}/g" profiles.yml
sed -i "s/__SNOWFLAKE_ROLE__/${SNOWFLAKE_ROLE}/g" profiles.yml
sed -i "s/__SNOWFLAKE_USER__/${SNOWFLAKE_USER}/g" profiles.yml
sed -i "s/__SNOWFLAKE_WAREHOUSE__/${SNOWFLAKE_WAREHOUSE}/g" profiles.yml

elif [ "$DBT_WAREHOUSE_PROVIDER" = "bigquery" ]; then
cp dbt_profiles.bigquery.yml profiles.yml

# TODO:
# sed -i "s/__SNOWFLAKE_ACCOUNT__/${SNOWFLAKE_ACCOUNT}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_DATABASE__/${SNOWFLAKE_DATABASE}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_PASSWORD__/${SNOWFLAKE_PASSWORD}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_ROLE__/${SNOWFLAKE_ROLE}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_USER__/${SNOWFLAKE_USER}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_WAREHOUSE__/${SNOWFLAKE_WAREHOUSE}/g" profiles.yml
fi

##
## Install system dependencies
##
Expand Down Expand Up @@ -49,32 +75,6 @@ elif [ "$DBT_WAREHOUSE_PROVIDER" = "bigquery" ]; then
pip install dbt-bigquery
fi

##
## Perform Environment-Specific variable subtitutions
##

if [ "$DBT_WAREHOUSE_PROVIDER" = "snowflake" ]; then
cp dbt_profiles.snowflake.yml profiles.yml

sed -i "s/__SNOWFLAKE_ACCOUNT__/${SNOWFLAKE_ACCOUNT}/g" profiles.yml
sed -i "s/__SNOWFLAKE_DATABASE__/${SNOWFLAKE_DATABASE}/g" profiles.yml
sed -i "s/__SNOWFLAKE_PASSWORD__/${SNOWFLAKE_PASSWORD}/g" profiles.yml
sed -i "s/__SNOWFLAKE_ROLE__/${SNOWFLAKE_ROLE}/g" profiles.yml
sed -i "s/__SNOWFLAKE_USER__/${SNOWFLAKE_USER}/g" profiles.yml
sed -i "s/__SNOWFLAKE_WAREHOUSE__/${SNOWFLAKE_WAREHOUSE}/g" profiles.yml

elif [ "$DBT_WAREHOUSE_PROVIDER" = "bigquery" ]; then
cp dbt_profiles.bigquery.yml profiles.yml

# TODO:
# sed -i "s/__SNOWFLAKE_ACCOUNT__/${SNOWFLAKE_ACCOUNT}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_DATABASE__/${SNOWFLAKE_DATABASE}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_PASSWORD__/${SNOWFLAKE_PASSWORD}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_ROLE__/${SNOWFLAKE_ROLE}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_USER__/${SNOWFLAKE_USER}/g" profiles.yml
# sed -i "s/__SNOWFLAKE_WAREHOUSE__/${SNOWFLAKE_WAREHOUSE}/g" profiles.yml
fi

# Confirm that the dbt installation was successful.
dbt --version

Expand Down

0 comments on commit a4b5f57

Please sign in to comment.