ジョブのビルド結果の自動ラベリングの設定

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

計画の各ジョブについて、(オプションとして) そのジョブの各ビルドの後に、ジョブのビルド結果に自動的に適用されるラベルを指定できます。

Automatic labeling of job builds 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.

ラベルは、Bamboo ユーザーが手動でビルド結果に適用することもできます。

On this page:

関連ページ

ジョブのビルド結果のラベルを指定する

ジョブのビルド結果のラベルを指定する方法は次のとおりです。

  1. ジョブの設定」で説明されているとおり、ジョブの設定ページに移動します。
  2. Select the Other tab.
  3. [正規表現パターン] を使用してすると、次のいずれかが可能です。
    • 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.
    • このフィールドは空欄のままにして、このジョブのすべてのビルドにラベルを付けます。
  4. "ラベル" フィールドに、計画のビルド結果にラベルを付ける単語 (またはコンマやスペースで区切った複数の単語) を入力します。
  5. 保存 を選択します。

正規表現の例

例については http://www.regular-expressions.info/reference.html をご覧ください。

簡単な正規表現の例:

'There are \d+ results'

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

  • "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.

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

  • "正規表現パターン" フィールドに次を入力します。

    (PERFORMANCE_IMPROVED|PERFORMANCE_DETERIORATED)
    
  • "ラベル" フィールドに次を入力します。

    \1
    
最終更新日 2021 年 5 月 31 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.