Bitbucket

Bitbucket Pipelines: PR Preview Environments

Applies to
Gatewayruntime for API, AI, and MCP gateways
Hosting
Managed EdgeManaged DedicatedSelf-HostedDiffers
1 difference by hosting option
Self-Hosted

Add --self-hosted-endpoint with your management API hostname to each zuplo deploy and zuplo delete command so it targets your cluster. See zuplo deploy.

Deploy preview environments for pull requests and clean up when they close.

YAMLbitbucket-pipelines.yml
image: node:24 pipelines: pull-requests: "**": - step: name: Deploy Preview script: - npm install - npx zuplo deploy --api-key "$ZUPLO_API_KEY" 2>&1 | tee ./DEPLOYMENT_STDOUT - echo "DEPLOYMENT_URL=$(grep -oP 'Deployed to \K(https://[^ ]+)' ./DEPLOYMENT_STDOUT)" >> deployment.env artifacts: - deployment.env - step: name: Run Tests script: - source deployment.env - npm install - npx zuplo test --endpoint "$DEPLOYMENT_URL" - step: name: Cleanup Preview script: - source deployment.env - npm install - npx zuplo delete --url "$DEPLOYMENT_URL" --api-key "$ZUPLO_API_KEY" --wait

The cleanup step runs after tests complete, deleting the preview environment.

Next Steps

Last modified on