Bitbucket Pipelines is a continuous integration and continuous delivery (CI/CD) service that's integrated with Bitbucket Cloud. Software development teams can use Bitbucket Pipelines to automatically build, test, and deploy code in Bitbucket.
To set up a Bitbucket Pipelines integration for your API, first create a pipeline in Bitbucket and then configure your API in Postman. After you set up the integration, you can view the status of builds or start a new build, all from within Postman.
If you haven't already, create a pipeline in the Bitbucket repository you use for your API. To create a pipeline, add a bitbucket-pipelines.yml
file in the root of your repository. You define your pipeline in this YAML file. To learn more, see the Bitbucket Pipelines documentation.
Tip: If you've already authenticated with Bitbucket to connect a Git repo for source control, you can use the same authentication. To automatically create the integration, under Test and Automation, select Connect to Bitbucket Pipelines.
After you set up a Bitbucket Pipelines integration, information for build jobs is available in Postman. For each build you can view the branch, start time, duration, and status (Successful
or Failed
). You can also view the results of collection runs that are configured in your pipeline using the Postman CLI.
To view build jobs, open an API and select Test and Automation. The most recent jobs are listed under the repository name.
Select View All Builds to view the full list of build jobs. From here you can take the following actions:
Using the Postman CLI, you can run Postman collections with your API tests as part of a Bitbucket pipeline.
To view details for collections that were run as part of a build, first configure the Postman CLI for Bitbucket Pipelines and then start a new build. After the build is complete, use the arrows to expand a build and expand a collection to view details about a collection run.
Select View Report to view a collection run report in the Postman History. Learn more about using the Collection Runner.
Using the Postman CLI, you can enforce Postman API Governance and API Security rules each time the pipeline runs using the api lint command (Enterprise teams only).
To view the results of API Governance and API Security checks that ran as part of the build, first configure the Postman CLI for Bitbucket Pipelines and then start a new build. After the build is complete, use the arrows to expand a build and expand an API definition to view any rule violations.
With the help of the Postman CLI and the Postman API, you can run Postman collections with your API tests as part of your Bitbucket pipeline. First generate the Postman CLI configuration code in Postman. Then add the configuration code to the bitbucket-pipelines.yml
file in your Bitbucket repository.
Each time the pipeline runs, the Postman CLI runs the collections that contain your tests. You can view the results of your tests in Postman. You can also enforce API Governance and API Security rules each time the pipeline runs (Enterprise teams only).
Before you begin, make sure you've already set up an integration between your API and Bitbucket Pipelines.
To generate configuration code for the Postman CLI, do the following:
To add the Postman CLI configuration to your Bitbucket pipeline, do the following:
bitbucket-pipelines.yml
file at the root of your Bitbucket repository.bitbucket-pipelines.yml
file. Then, replace all instances of $POSTMAN_API_KEY
with a valid Postman API Key.Last modified: 2024/07/02