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 with Bamboo task using Run CLI actions in Bamboo.

Instructions

  1. Log in to Bamboo with Plan admin permissions.
  2. Navigate to Plan the required plan and Click select Actions > Click Configure > Configure plan:.
    Image RemovedImage Added
  3. Click Default StageJob to add tasks in Default the default stage:.
    Image RemovedImage Added
  4. Click Add Task to add a Bamboo CLI task in Default Job:.
    Image RemovedImage Added
  5. Search for Bamboo CLI in using the search bar and Select select the Bamboo CLI task:.
    Image RemovedIn Bamboo CLI task window, add below Image Added
  6. Add the addLabels action to Script body to add labels to current build :and click Save to save the configuration.

    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, 


    Image Added

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

...

  • .

...