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 into 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.

On this page:

Specifying Labels for a Job's Build Results

To specify labels for a Job's build results:

  1. Navigate to a Job's configuration pages, as described on Editing a Job.
  2. Click the 'Post Actions' sub-tab (see screenshot below).
  3. 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.
  4. 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.
  5. Click the 'Save' button to save your changes.



Screenshot: 'Post Actions'

Regex Examples:

簡単な正規表現の例:

'There are \d+ results'

上記の正規表現で、「\d+」は 1 桁以上の任意の数字を表します。「\d」は "任意の桁" を意味し、「+」は "1 回以上" を意味します。組み合わせると、"1 桁以上の任意のシーケンス" を意味します。したがって、一致するものには次が含まれます。

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

複数のラベルが付いた正規表現の例:
Bamboo 1.2.1 以降では "グループのキャプチャ" を使用して、さまざまな目的に異なるラベルを作成できます。

たとえば、次の設定では、ビルド ログに "PERFORMANCE_IMPROVED" と表示されていれば "PERFORMANCE_IMPROVED" というラベルが付き、ビルド ログに "PERFORMANCE_DETERIORATED" と表示されていれば "PERFORMANCE_DETERIORATED" というラベルが付きます。両方の文字列がログに表示されている場合は、両方のラベルがビルドに適用されます。

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

注意

関連トピック

Editing a Job