This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

For each Job of a Plan, you can (as an option) specify a 'post action' label that can be applied to the Job's build results automatically after (or 'post') each build of that Job.

Automatic labelling of Job builds is a 'post action' feature (i.e. performed at the completion of Job builds), which is built in to Bamboo itself. There are a number of third-party plugin modules available that can provide additional post actions (e.g. the Pre-Post Build Command plugin). You can also write your own plugins to provide additional post actions for a Job. See the Bamboo Plugin Guide for further details.

A label is a convenient way to tag and group build results that are logically related to each other. Labels can also be used to define RSS feeds and to control build expiry.

Labels can be applied to build results automatically, by specifying the label(s) in a build plan (note that only Bamboo administrators can do this). Labels can also be applied ad hoc to build results by Bamboo users.

To specify labels for a Job's build results,

  1. Access the Job's configuration pages. To do this:
    1. Click 'Home' to go to the Dashboard.
    2. Click the 'All Plans' tab.
    3. Locate the Job's Plan in the list and click the Plan's name (i.e. before the first '>'). The Plan's Plan Summary page will be displayed.
    4. In the Stages section of this page, click the name of the Job you wish to configure. The Job's Job Summary page will be displayed.
      (tick) If necessary, expand the appropriate Stage to access your Job.
    5. Click the 'Actions' dropdown menu on the right and select 'Configure Job'. The Job's Configuration pages will be displayed.
  2. Click the 'Post Actions' sub-tab.
  3. The 'Post Actions' tab will be displayed (see screenshot below).
  4. In the 'Regex Pattern' field, you can either:
    • Specify a regular expression to match content in the log files of this Job's builds. Labels will be applied to a build of this Job if this regular expression matches content in the build's log files (see the examples below).
      (info) For more information about regular expressions, please refer to the Java documentation on regular expression constructs.
    • Leave this field blank to label every build of this Job.
  5. In the 'Labels' field, type the word (or multiple words, separated by commas and/or spaces) with which the Plan's build results are to be labelled.
  6. Click the 'Save' button to save your changes.

Regex Examples:


簡単な正規表現の例:

'There are \d+ results'

In the above regex, '\d+' represents any number with one or more digits. ('\d' means 'any digit', and '+' means 'one or more times'. When combined, they mean 'any sequence of one or more digits'.)

Therefore, positive matches would include:

  • "0 件の結果があります"
  • "123 件の結果があります"

A regex example with multiple labels:

You can use "capturing groups" with Bamboo 1.2.1 or later to create different labels for different purposes.

例:

  • Enter the following into the 'Regex Pattern' field:
    (PERFORMANCE_IMPROVED|PERFORMANCE_DETERIORATED)
    
  • Enter the following into the 'Labels' field:
    \1
    

These settings will label your builds with PERFORMANCE_IMPROVED if "PERFORMANCE_IMPROVED" appears in the build log, and PERFORMANCE_DETERIORATED if "PERFORMANCE_DETERIORATED" appears in the build log. If both strings appear in a log, then both labels are applied to the build.


Screenshot: 'Post Actions'