Bitbucket Pipes​Bitbucket ​Pipes

How to use Bitbucket Pipes to create a CI/CD pipeline for your Kestra flows.

Set Up a Bitbucket Pipe

With the Kestra Docker image and CLI, you can validate and deploy flows from Bitbucket repositories through Bitbucket Pipes.

Here is a basic pipeline:

yaml

image: kestra/kestra

pipelines:
  default:
    - step:
        name: 'Validate Kestra flows'
        deployment: staging
        script:
          - /bin/sh /app/kestra flow validate flows/ --server $SERVER --tenant $TENANT --user $KESTRA_USER:$KESTRA_PASSWORD

    - step:
        name: 'Deploy Kestra flows'
        deployment: production
        script:
          - echo $SERVER
          - echo $KESTRA_USER
          - echo $KESTRA_PASSWORD
          - /bin/sh /app/kestra flow namespace update dev flows/ --server=$SERVER --tenant=$TENANT --user=$KESTRA_USER:$KESTRA_PASSWORD

Variables such as $SERVER, $KESTRA_USER, $KESTRA_PASSWORD, and optionally $TENANT (for multi-tenant environments) are set in the Bitbucket variable configuration:

Bitbucket Pipes Variable

This example uses the Kestra CLI to:

  1. Validate flows contained in the flows/ directory of the repository.
  2. Deploy flows into the company.team namespace of your Kestra instance.

Was this page helpful?