Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to add labels to the current build as Bamboo task using Run CLI actions in Bamboo.

Instructions

  1. Login Log in to Bamboo with Plan admin permissions.
  2. Navigate to Plan and Click Actions > Click Configure plan:
    Image RemovedImage Added
  3. Click Default Stage to add tasks in Default stage:
    Image RemovedImage Added
  4. Click Add Task to add a Bamboo CLI task in Default Job:
    Image RemovedImage Added
  5. Search Bamboo CLI in search bar and Select Bamboo CLI task:
    Image RemovedImage Added
  6. In Bamboo CLI task window, add below addLabels action to Script body add labels to current build:

    Code Block
    themeMidnight
    --action addLabels --plan DEMO-CLI --labels "qa-pass"  --number ${bamboo.buildNumber} --server "Bamboo_Server" --user "BambooUser_username" --password "BambooUser_Password"

    In above CLI action, 

    1. --plan value refers to plan key. 

    2. --labels value refers to labels name
    3. --number valuer refers to a bamboo variable named as ${bamboo.buildNumber} to define current build number.
    4. --server value refers to the Bamboo Server urlURL.
    5. --user value refers to the Bamboo username
    6. --password value refers to the Bamboo password
  7. Click Save to Save the Configuration and with this when build run completes mentioned labels will be added to current build:
    Image Removedsave the configuration. With this, the mentioned labels are added to the current build once the build run is complete.
    Image Added