How to add labels to current build with Bamboo task using Run CLI Actions in Bamboo
This article explains how to add labels to the current build with Bamboo task using Run CLI actions in Bamboo.
Instructions
- Log in to Bamboo with Plan admin permissions.
- Navigate to the required plan and select Actions > Configure plan.
- Click Default Job to add tasks in the default stage.
- Click Add Task to add a Bamboo CLI task in Default Job.
- Search for Bamboo CLI using the search bar and select the Bamboo CLI task.
Add the addLabels action to Script body to add labels to current build and click Save to save the configuration.
--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:
--plan value refers to plan key.Â
- --labels value refers to labels name.
- --number 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.