This article explains how to add labels to the current build as with Bamboo task using Run CLI actions in Bamboo.
Instructions
- Log in to Bamboo with Plan admin permissions.
- Navigate to Plan the required plan and Click select Actions > Click Configure > Configure plan:.
- Click Default StageJob to add tasks in Default the default stage:.
- Click Add Task to add a Bamboo CLI task in Default Job:.
- Search for Bamboo CLI in using the search bar and Select select the Bamboo CLI task:.
In Bamboo CLI task window, add below Add the addLabels action to Script body to add labels to current build :and click Save to save the configuration.
In above CLI action,Code Block theme Midnight --action addLabels --plan DEMO-CLI --labels "qa-pass" --number ${bamboo.buildNumber} --server "Bamboo_Server" --user "BambooUser_username" --password "BambooUser_Password"
With this, the specified labels are added to the current build after the build run is completed.
In the given CLI action:
...
- value refers to a
...
- Bamboo variable named as ${bamboo.buildNumber} to define current build number.
- --server value refers to the Bamboo
...
- server URL.
- --user value refers to the Bamboo username.
- --password value refers to the Bamboo password
...
- .
...