ZuploZuplo
LoginStart for Free
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
Monetization
Deploying & Source Control
    Overview
    GitHub
    GitLab
    Bitbucket
      SetupBasic DeploymentDeploy and TestPR Preview EnvironmentsLocal Testing in CITag-Based ReleasesMulti-Stage Deployment
    Azure DevOps
    CircleCI
    Custom CI/CDMonorepo DeploymentRename/Move Project
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Bitbucket

Bitbucket Pipelines: PR Preview Environments

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

bitbucket-pipelines.yml
image: node:20 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

  • Implement multi-stage deployment for production
Edit this page
Last modified on December 3, 2025
Deploy and TestLocal Testing in CI
On this page
  • Next Steps
YAML