Astro CI/CD templates for Bitbucket
Use the following CI/CD templates to automate deploying Apache Airflow DAGs from a Git repository to Astro with Bitbucket.
The templates for Bitbucket use the image-only deploy process with a single branch implementation, which requires only one Astro Deployment.
If you use the DAG-only deploy feature on Astro or you're interested in a multiple-branch implementation, see Template overview to configure your own. To learn more about CI/CD on Astro, see Choose a CI/CD strategy.
Prerequisites
- An Astro project hosted in a Git repository that Bitbucket can access.
- An Astro Deployment.
- Either a Deployment API key ID and secret, a Workspace API token, or an Organization API token.
- Access to Bitbucket.
Single branch implementation
To automate code deploys to a Deployment using Bitbucket, complete the following setup in a Git-based repository that hosts an Astro project:
Set the following environment variables as Bitbucket pipeline variables:
ASTRONOMER_KEY_ID
=<your-key-id>
ASTRONOMER_KEY_SECRET
=<your-key-secret>
Create a new YAML file in
bitbucket-pipelines.yml
at the root of the repository that includes the following configuration:pipelines:
pull-requests: # The branch pattern under pull requests defines the *source* branch.
dev:
- step:
name: Deploy to Production
deployment: Production
script:
- curl -sSL install.astronomer.io | sudo bash -s
- astro deploy
services:
- docker