This article explains how to add labels to current build as Bamboo task using Run CLI actions in Bamboo.
Instructions
- Login 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 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 Bamboo Server url.
- --user value refers to Bamboo username
- --password value refers to Bamboo password
Click Save to Save the Configuration and with this when build run completes mentioned labels will be added to current build: