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. Locate the build plan that you wish to associate an artifact with. Select Configure plan from the 'Actions' drop down menu. The plan configuration window will display:
  2. In the left pane, click on Stages & jobs and select a job or create a new job if one does not already exist. Click on the Tasks tab for the selected job. The 'Tasks' pane will appear
  3. Click the Add task button. The 'Task types' window will appear. Select Artifact Downloader Task to open the 'Artifact downloader task' configuration pane:

    Complete the configuration using the following options:

    フィールド説明 Optional?
    タスクの説明アーティファクト ダウンローダー タスクの簡単な説明(tick)
    このタスクを無効化このボックスをチェックすると、タスクが無効になります-
    ソース計画ダウンロードする必要があるアーティファクトのソースであるビルド計画(error)
    アーティファクト名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)
  4. [Add another artifact (別のアーティファクトを追加)] をクリックして、別のアーティファクトをダウンロード リストに追加します。または、灰色の十字アイコンを使用して、構成からアーティファクトを削除します。
  5. [保存] をクリックして、アーティファクトのダウンロード設定を保存します。
  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. Destination directory is relative to the build directory. Do not use the absolute path to refer to the destination director

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

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

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

  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. Click on the Add task button. The 'Task type' selection window will display. Select Artifact Downloader Task to open the 'Artifact downloader task configuration' pane:

    Complete the configuration using the following options:

    フィールド説明 Optional?
    タスクの説明アーティファクト ダウンローダー タスクの簡単な説明(tick)
    このタスクを無効化このボックスをチェックすると、タスクが無効になります-
    ソース計画The plan that is the source of the artifact you need downloading(error)
    アーティファクト名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. Click on Add another artifact to add another artifact to the download list. 
  4. Click on Save to save your artifact download configuration.

 

  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. Destination directory is relative to the build directory. Do not use the absolute path to refer to the destination director
  • ラベルなし