Manual steps allow you to customize your CI/CD pipeline by making some steps run only they're manually triggered. This is useful for items such as deployment steps, where manual testing or checks are required before the step runs.
Configure a step as manual by adding
trigger: manual to the step in your
As pipelines trigger on a commit, you can't make the first step manual. If you'd like a pipeline to only run manually, you can set up a custom pipeline instead. Another advantage of a custom pipeline is that you can , for example to add a version number, or supply a single use value.
Any existing pipeline can also be manually run against a specific commit, or as a scheduled build.
If you want a pipeline to only run manually then use a custom pipeline. Custom pipelines do not run automatically on a commit to a branch. To define a custom pipeline, add the pipeline configuration in the
section of your
bitbucket-pipelines.yml file. Pipelines which are not defined as a custom pipeline will also run automatically when a push to the branch occurs.
You'll need write permission on the repository to run a pipeline manually, and you can trigger it from the Bitbucket Cloud UI.
Step 1: Add a pipeline to the bitbucket-pipelines.yml file
You can manually trigger a build for any pipeline build configuration included in your bitbucket-pipelines.yml file:
pipelines: custom: # Pipelines that can only be triggered manually sonar: - step: script: - echo "Manual triggers for Sonar are awesome!" deployment-to-prod: - step: script: - echo "Manual triggers for deployments are awesome!" branches: # Pipelines that run automatically on a commit to a branch can also be triggered manually staging: - step: script: - echo "Automated pipelines are cool too."
Step 2: Trigger the pipeline from Bitbucket Cloud
Pipelines can be triggered manually from either the Branches view or the Commits view in the Bitbucket Cloud interface.
- In Bitbucket, choose a repo and go to Branches.
- Choose the branch you want to run a pipeline for.
- Click (...) , and select Run pipeline for a branch.
- Choose a pipeline and click Run:
- In Bitbucket, choose a repo and go to Commits.
- Go to the Commits view for a commit.
- Select a commit hash.
- Select Run pipeline.
- Choose a pipeline, then click Run:
- In Bitbucket, choose a repo and go to Pipelines.
- Click Run pipeline
- Choose branch, a pipeline, and click Run
Additionally, you can run custom pipelines manually parsing variables to the pipeline.
To enable the variables, define them under the custom pipeline that you want to enter when you run the pipeline:
pipelines: custom: custom-name-and-region: #name of this pipeline - variables: #list variable names under here - name: Username - name: Region - step: script: - echo "User name is $Username" - echo "and they are in $Region"
Then, when you run a custom pipeline (Branches > ⋯ > Run pipeline for a branch > Custom:..) you'll be able to fill them in.