Version control your dbt Cloud jobs with YML.
Project description
dbt-cloud-jobs
Version control your dbt Cloud jobs with YML.
Installation
pip install dbt-cloud-jobs
Quickstart
-
Create an API token in dbt Cloud:
- Generate a service account token, make sure to grant the
Jobs Admin
permission set. - If you do not have access to create a service account token you can create a User API token. Note that the service account method is preferred.
- Generate a service account token, make sure to grant the
-
Set an environment variables with the value of the token:
export DBT_API_TOKEN="<VALUE_FROM_PREVIOUS_STEP>"
-
Import your existing dbt Cloud jobs:
dbt_cloud_jobs --import --account_id 123456 --file dbt_cloud_jobs.yml
-
Edit the definition of your jobs in
dbt_cloud_jobs.yml
. -
Sync the updated definitions to dbt Cloud:
dbt_cloud_jobs --sync --file dbt_cloud_jobs.yml
Recommended usage in CI/CD
CI
In CI dbt_cloud_jobs
should be used to verify that the provided YML file is valid. For example:
- name: Install dbt_cloud_jobs
run: pip install dbt_cloud_jobs
- name: Validate `dbt_cloud_jobs.yml`
run: dbt_cloud_jobs --validate --file dbt_cloud_jobs.yml
CD
In CD dbt_cloud_jobs
should be used to sync the provided YML file to dbt Cloud. For example:
- name: Install dbt_cloud_jobs
run: pip install dbt_cloud_jobs
- name: Sync `dbt_cloud_jobs.yml`
run: dbt_cloud_jobs --sync --file dbt_cloud_jobs.yml
Development
Release
Trigger the Publish to PyPi
workflow, inputting the version to publish to PyPi. This workflow will:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dbt_cloud_jobs-0.0.0a1.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for dbt_cloud_jobs-0.0.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb3603211abc40b36026180832aefea46c009267777519d30e8f1e6beaddc76e |
|
MD5 | da31ee6af4e6fbffe83b08e93902cd8e |
|
BLAKE2b-256 | c51ae8dd4f13b6c81269bedfca13ab1aa9c12e47c285375d8bc0f6e50b6ba0c7 |