Blueprints

Git workflow for dbt with Postgres

Source

yaml
id: dbt-postgres
namespace: company.team

tasks:
  - id: git
    type: io.kestra.plugin.core.flow.WorkingDirectory
    tasks:
      - id: clone_repository
        type: io.kestra.plugin.git.Clone
        url: https://github.com/kestra-io/dbt-example
        branch: main

      - id: dbt
        type: io.kestra.plugin.dbt.cli.DbtCLI
        containerImage: ghcr.io/kestra-io/dbt-postgres:latest
        profiles: |
          my_dbt_project:
            outputs:
              dev:
                type: postgres
                host: myhostname.us-east-1.rds.amazonaws.com
                user: "{{ secret('POSTGRES_USER') }}"
                password: "{{ secret('POSTGRES_PASSWORD') }}"
                port: 5432
                dbname: postgres
                schema: public
                threads: 8
                connect_timeout: 10
            target: dev
        commands:
          - dbt deps
          - dbt build

About this blueprint

Postgres Git dbt

This flow: - clones a dbt Git repository from GitHub - pulls a public container image with the required dependencies - runs dbt CLI commands in a Docker container To run a flow from this blueprint, you can simply copy-paste the contents of your ~/.dbt/profiles.yml into the profiles section and you're good to go!

Working Directory

Clone

Dbt CLI

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra