This is the documentation for Bamboo 5.7. View this page for the

Unknown macro: {spacejump}

of Bamboo, or visit the latest Bamboo documentation.

This page describes how to share artifacts. Bamboo allows artifact sharing between:

  • ジョブ
  • Build plans
  • Build plans to deployment environments.

 

ジョブ間での成果物の共有

You can share artifacts between jobs in different stages using artifact dependencies. For example, you may want to run acceptance tests on a build, sharing the same WAR from one job to another without rebuilding it each time.

アーティファクトが後続のジョブと共有されるたびに、ジョブのエージェントにコピーされます。

異なるステージにある 2 つのジョブ間でアーティファクトを共有する方法は次のとおりです。

  1. Navigate to the configuration pages for the job that will produce the artifact, as described on Configuring jobs, and click the Artifacts tab (see Configuring a job's build artifacts).
  2. Click Edit for the artifact that you want to share. The artifact definition will be displayed.
  3. Select the Shared check box and then click Save.
  4. Navigate to the job in a subsequent stage that will consume the artifact, and click the Artifacts tab. Click Create Dependency. Complete the fields on the screen (see screenshot below) and click Create.

  1. The Artifact list only shows artifacts from jobs in previous stages that have been marked as shared. This is described in Configuring a job's build artifacts.
  2. [移動先ディレクトリ] はビルド ディレクトリと相対関係があります。移動先ディレクトリを参照するのに絶対パスを使用しないでください。

Screenshot: Creating an artifact dependency

ビルド プラン間での成果物の共有

異なるビルド計画間でアーティファクトを共有できますが、その共有には "アーティファクト ダウンローダー タスク" を使用する必要があります。たとえば、WAR を毎回再構築せずに、同じ WAR をある計画から別の計画へと共有することで、別の計画の特定ビルドで受け入れテストを実行するとします。

2 つのビルド計画でアーティファクトを共有する方法は次のとおりです。

  1. アーティファクトを関連付けるビルド計画を探します。 
    1. Select Configure plan from the 'Actions' drop down menu. The plan configuration window will display
    2. Click on Stages & jobs and select a job or create a new job if one does not already exist 
    3. Click on the Tasks tab for the selected job. The 'Tasks' pane will appear
  2. [タスクを追加] ボタンをクリックします。"タスクの種類" ウィンドウが表示されます。[Artifact Downloader Task (アーティファクト ダウンローダー タスク)] を選択して、"アーティファクト ダウンローダー タスク" 設定ペインを開きます。

     
    次のオプションを使用して、設定を完了します。

    フィールド説明 Optional?
    タスクの説明アーティファクト ダウンローダー タスクの簡単な説明(tick)
    このタスクを無効化このボックスをチェックすると、タスクが無効になります-
    ソース計画ダウンロードする必要があるアーティファクトのソースであるビルド計画(error)
  3. [Add another artifact (別のアーティファクトを追加)] をクリックして、別のアーティファクトをダウンロード リストに追加します。または、灰色の十字アイコンを使用して、構成からアーティファクトを削除します。
  4. [保存] をクリックして、アーティファクトのダウンロード設定を保存します。
  1. The Artifact drop down menu only shows artifacts from jobs in previous stages that have been marked as shared. This is described in  Configuring a job's build artifacts
  2. [移動先ディレクトリ] はビルド ディレクトリと相対関係があります。移動先ディレクトリを参照するのに絶対パスを使用しないでください。
  3. 最新の成功したビルドのアーティファクトが使用されます。アーティファクトを生成する計画のビルドが成功しなかったり、アーティファクトの有効期限が切れたりすると、そのアーティファクトを使用するジョブは失敗します。

ビルド プランからデプロイメント環境への成果物の共有

ビルド計画からデプロイ環境へも、アーティファクトを共有できます。たとえば、計画の特定のビルド結果をデプロイ環境と共有するとします。そのためには、環境を作成中または作成後に "アーティファクト ダウンローダー タスク" をデプロイ環境に追加する必要があります。 

ビルド計画からデプロイ環境へアーティファクトを共有する方法は次のとおりです。

  1. Open your deployment project and expand the relevant environment panel. In the Other settings section, click on the Tasks button. The 'Set up tasks' screen will display:


  2. [タスクを追加] をクリックします。"タスクの種類" 選択ウィンドウが表示されます。[Artifact Downloader Task (アーティファクト ダウンローダー タスク)] を選択して、"アーティファクト ダウンローダー タスク" 設定ペインを開きます。


     
    次のオプションを使用して、設定を完了します。

    フィールド説明 Optional?
    タスクの説明アーティファクト ダウンローダー タスクの簡単な説明(tick)
    このタスクを無効化このボックスをチェックすると、タスクが無効になります-
    アーティファクト名Use the drop down menu to locate the name of the artifact that you want to download(error)
    宛先パスThe location of the working directory into which you want the artifact downloaded(tick)
  3. [Add another artifact (別のアーティファクトを追加)] をクリックして、別のアーティファクトをダウンロード リストに追加します。 
  4. [保存] をクリックして、アーティファクトのダウンロード設定を保存します。

 

  1. The Artifact drop down menu only shows artifacts from jobs in previous stages that have been marked as shared. This is described in  Configuring a job's build artifacts
  2. [移動先ディレクトリ] はビルド ディレクトリと相対関係があります。移動先ディレクトリを参照するのに絶対パスを使用しないでください。
  • ラベルなし