Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dbt job to run the enterprise reporting models daily #1581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 54 additions & 0 deletions dataeng/jobs/analytics/DBTRun.groovy
Expand Up @@ -112,5 +112,59 @@ class DBTRun{
shell(dslFactory.readFileFromWorkspace('dataeng/resources/dbt-run.sh'))
}
}
dslFactory.job("dbt-enterprise-reporting"){
description(
"Automatically run dbt for enterprise reporting <strong>in production</strong>, overwriting data in " +
"the PROD database. This job triggers transfer-dbt-models-daily to upload this data to S3."
)
logRotator common_log_rotator(allVars)
parameters secure_scm_parameters(allVars)
environmentVariables {
env('WAREHOUSE_TRANSFORMS_URL', allVars.get('WAREHOUSE_TRANSFORMS_URL'))
env('WAREHOUSE_TRANSFORMS_BRANCH', allVars.get('WAREHOUSE_TRANSFORMS_BRANCH'))
env('DBT_TARGET', allVars.get('DBT_TARGET'))
env('DBT_PROFILE', allVars.get('DBT_PROFILE'))
env('DBT_PROJECT_PATH', 'automated/applications')
env('DBT_MODEL_INCLUDE', 'enterprise_user_lpr enterprise_offer_aggregates')
env('DBT_MODEL_EXCLUDE', allVars.get('DBT_MODEL_EXCLUDE'))
env('FULL_REFRESH', false)
env('DBT_RUN_ARGS', allVars.get('DBT_RUN_ARGS'))
env('SKIP_TESTS', true)
env('DBT_TEST_ARGS', allVars.get('DBT_TEST_ARGS'))
env('JOB_TYPE', 'automated')
env('NOTIFY', allVars.get('$PAGER_NOTIFY'))
}
multiscm secure_scm(allVars) << {
git {
remote {
url('$WAREHOUSE_TRANSFORMS_URL')
branch('$WAREHOUSE_TRANSFORMS_BRANCH')
}
extensions {
relativeTargetDirectory('warehouse-transforms')
pruneBranches()
cleanAfterCheckout()
}
}
}
triggers {
scm('0 6 * * *') // 6am UTC daily
}
wrappers {
colorizeOutput('xterm')
timestamps()
credentialsBinding {
usernamePassword('GITHUB_USER', 'GITHUB_TOKEN', 'GITHUB_USER_PASS_COMBO');
}
}
wrappers common_wrappers(allVars)
publishers common_publishers(allVars)
steps {
shell(dslFactory.readFileFromWorkspace('dataeng/resources/dbt-run.sh'))
downstreamParameterized {
trigger("transfer-dbt-models-daily")
}
}
}
}
}