0

How can I run dbt commands within a bitbucket pipeline? What is the correct docker image that I should be using if I wanted to use dbt-snowflake? I tried fishtownanalytics/dbtand joevandyk/dbtboth:

pipelines:
  custom: 
    test-dbt:
      - step:
          name: 'Test'
          image: fishtownanalytics/dbt
          script:
            - cd dbt_4flow
            - dbt compile

but I still get this error:

+ dbt compile
bash: dbt: command not found
  • could you show your Dockerfile please ? – Driss NEJJAR Mar 07 '22 at 12:07
  • I don't have a docker file of my own? I am just using ```image: fishtownanalytics/dbt``` https://hub.docker.com/u/fishtownanalytics and https://hub.docker.com/r/joevandyk/dbt @dnej –  Mar 07 '22 at 12:11
  • when I try to pull the image locally using `docker pull fishtownanalytics/dbt`, I am not able, but by adding the version: `docker pull fishtownanalytics/dbt:1.0.0`, I am able, could you try adding the version in you bitbucket script ? – Driss NEJJAR Mar 07 '22 at 12:15
  • fishtownanalytics/dbt is depreciated. Instead use this: `docker pull ghcr.io/dbt-labs/dbt-core:1.1.2` and check here for a full list; https://github.com/orgs/dbt-labs/packages?visibility=public – Gidi9 Aug 18 '22 at 14:29

2 Answers2

0

When I try to pull the image locally using

docker pull fishtownanalytics/dbt

I am not able, but by adding the version:

docker pull fishtownanalytics/dbt:1.0.0

It's working.

You need to add the version to your bitbucket pipeline, so you will be able to do it.

Driss NEJJAR
  • 872
  • 5
  • 22
0

As mentioned above, you need to specify the version for fishtownanalytics.

image: fishtownanalytics/dbt:1.0.0

Here's a full tutorial for creating a similar pipeline: https://medium.com/geekculture/automate-dbt-runs-with-bitbucket-pipelines-3e7528ff991f

x89
  • 2,798
  • 5
  • 46
  • 110