Bitbucket Pipes for Kestra – Build and Deploy from Bitbucket icon Bitbucket Pipes for Kestra – Build and Deploy from Bitbucket

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

Automate Kestra deployments with Bitbucket Pipes

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

Here is a basic pipeline:

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?