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:

  • Jobs
  • Build plans
  • Build plans to deployment environments.

 

Sharing artifacts between jobs

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.

Each time the artifact is shared with a subsequent job, it is copied to the job's agent.

To share an artifact between two jobs in different stages:

  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. Destination directory is relative to the build directory. Do not use the absolute path to refer to the destination directory.

Screenshot: Creating an artifact dependency

Sharing artifacts between build plans

You can share artifacts between different build plans, however you need to use the 'Artifact downloader task' to do so. For example, you may want to run acceptance tests on a particular build from a different plan by sharing the same WAR from one plan to another without rebuilding it each time.

To share an artifact between two build plans:

  1. Locate the build plan that you wish to associate an artifact with. 
    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. 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:

    FieldDescriptionOptional?
    Task descriptionA brief description of the artifact downloader task(tick)
    Disable this taskCheck this box to disable the task-
    Source PlanThe build plan that is the source of the artifact you need to download(error)
  3. Click on Add another artifact to add another artifact to the download list. Alternatively, use the grey cross icon to delete an artifact from your configuration
  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 directory.
  3. The artifact from the most recent successful build will be used. If there are no successful builds from the artifact-producing plan or the artifacts have expired, the artifact-consuming job will fail.

Sharing artifacts from a build plan to a deployment environment

You can also share artifacts from a build plan into a deployment environment. For example, you may wish to share a particular build result from a plan with a deployment environment. To do this, you need to add the 'Artifact downloader task' to a deployment environment during or after the environment creation process. 

To share an artifact from a build plan to a deployment environment:

  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 Add task. 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:

    FieldDescriptionOptional?
    Task descriptionA brief description of the artifact downloader task(tick)
    Disable this taskCheck this box to disable the task-
    Artifact NameUse the drop down menu to locate the name of the artifact that you want to download(error)
    Destination PathThe location of the working directory into which you want the artifact downloaded(tick)
  3. Click Add another artifact to add another artifact to the download list. 
  4. Click 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 directory.
  • No labels