forked from gooddata/gooddata-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
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 gooddata#422 from jaceksan/working
TRIVIAL: gooddata-dbt - update documentation Reviewed-by: Jan Kadlec https://github.com/hkad98
- Loading branch information
Showing
3 changed files
with
87 additions
and
32 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,11 @@ | ||
#!/bin/env bash | ||
# (C) 2023 GoodData Corporation | ||
|
||
export DB_PASS="<db_password>" | ||
|
||
# dbt cloud | ||
export DBT_ACCOUNT_ID=123456 | ||
export DBT_TOKEN="<dbt cloud token>" | ||
|
||
# Gitlab token for commenting merge requests | ||
export GITLAB_TOKEN="<Gitlab token>" |
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,58 @@ | ||
#!/bin/env bash | ||
# (C) 2023 GoodData Corporation | ||
|
||
if [ -f "./.env.custom.dev" ]; then | ||
source ./.env.custom.dev | ||
fi | ||
|
||
export DBT_PROFILES_DIR="profile" | ||
export ELT_ENVIRONMENT="production" | ||
export DBT_TARGET="snowflake" | ||
|
||
export DB_USER="db_user" | ||
export DB_NAME="DB_NAME" | ||
export OUTPUT_SCHEMA="output_stage" | ||
|
||
# Snowflake specific | ||
export DB_ACCOUNT="snowflake_account" | ||
export DB_WAREHOUSE="MY_WAREHOUSE" | ||
export GOODDATA_UPPER_CASE="--gooddata-upper-case" # Snowflake names are upper case | ||
|
||
# GoodData | ||
# We use profiles file(~/.gooddata/profiles.yaml) to store GoodData endpoints and their credentials | ||
# Example: | ||
# dev: | ||
# host: "https://company-dev.cloud.gooddata.com" | ||
# token: "<dev_token>" | ||
# prod1: | ||
# host: "https://company-prod1.cloud.gooddata.com" | ||
# token: "<prod1_token>" | ||
# prod2: | ||
# host: "https://company-prod2.cloud.gooddata.com" | ||
# token: "<prod2_token>" | ||
export GOODDATA_PROFILES="prod1 prod2" | ||
export GOODDATA_ENVIRONMENT_ID="production" | ||
|
||
# Gitlab (for testing sending messages to merge requests | ||
export CI_MERGE_REQUEST_PROJECT_ID=123456 | ||
export CI_MERGE_REQUEST_IID=1 | ||
|
||
# dbt cloud - test running a dbt cloud job | ||
export DBT_ALLOWED_DEGRADATION=20 | ||
export DBT_JOB_ID=123456 | ||
export DBT_PROJECT_ID=123456 | ||
export DBT_ENVIRONMENT_ID=123456 | ||
|
||
# dbt env var needed for dbt Cloud | ||
# First delete all existing DBT variables. Uncomment to cleanup your sessions ;-) | ||
#for var in $(env | grep -E '^DBT_' | cut -d= -f1); do | ||
# unset "$var" | ||
#done | ||
for var in $(env | grep -E '^DB_|_SCHEMA' | grep -vE '^DBT_' | cut -d= -f1); do | ||
# Add "DBT_" prefix to variables without DBT_ prefix | ||
new_var="DBT_${var}" | ||
# Get the value of the original variable | ||
value="${!var}" | ||
# Set the new variable with the modified value | ||
export "$new_var=$value" | ||
done |
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