Implement an Approval workflow for deployments in Bamboo
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
In some use-cases, deployments and releases might require approval prior to being executed. Currently, Bamboo doesn't offer a native Approval workflow for Deployments. There is a feature request open for this: BAM-13356
This article will cover a workaround to implement an approval-like workflow.
The steps suggested below might not be applicable to your scenario, as this depends on the specificities of your build and deployment workflow.
Solution
As a workaround, we can make use of the "Manual Stages" feature on the Deployment's Source Build Plan to achieve something similar to a manual "Approve deployment" button. For that:
On your Deployment's source build plan, add a Manual Stage at the end of the build configuration. Manual Stages are not executed automatically and require a user to trigger them manually.
On your Deployment configuration, remove any current triggers, add a new trigger of the "After successful stage" type, and select the Manual Stage you have just created. This type of trigger only runs the deployment if the specified stage runs successfully.
In order for the stage to run successfully, you'll also need to add a simple task to it. For example, you can add a Script Task that performs
echo "Deployment has been approved"
.Given that the manual stage will not be executed automatically, your deployment will not be triggered after every single build. In order to trigger the deployment, you'd need to manually run the Manual Stage from the build result you want to deploy.
This would then work like an Approval button.
Was this helpful?