This article explains how to add labels to the current build as Bamboo task using Run CLI actions in Bamboo.
Instructions
- Log in to Bamboo with Plan admin permissions.
- Navigate to Plan and Click Actions > Click Configure plan:
- Click Default Stage to add tasks in Default stage:
- Click Add Task to add a Bamboo CLI task in Default Job:
- Search Bamboo CLI in search bar and Select Bamboo CLI task:
In Bamboo CLI task window, add below addLabels action to Script body add labels to current build:
--action addLabels --plan DEMO-CLI --labels "qa-pass" --number ${bamboo.buildNumber} --server "Bamboo_Server" --user "BambooUser_username" --password "BambooUser_Password"
In above CLI action,
--plan value refers to plan key.
- --labels value refers to labels name
- --number valuer 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
Click Save to save the configuration. With this, the mentioned labels are added to the current build once the build run is complete.