Skip to end of metadata
Go to start of metadata

This page describes how to configure artifact sharing between jobs in a plan. Artifact sharing allows you to pass an artifact from one job to a job in a subsequent stage. That is, the artifact is copied to the subsequent job's agent. Note, you cannot pass artifacts between jobs in the same stage.

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.

Sharing artifacts between jobs

You can share artifacts between jobs in different stages using artifact dependencies. 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.
  2. Click the Artifacts tab (see Configuring a job's build artifacts).
  3. Click Edit for the artifact that you want to share. The artifact definition will be displayed.
  4. Select the Shared check box and then click Save.
  5. Navigate to the job in a subsequent stage that will consume the artifact, and click the Artifacts tab.
  6. Click Create Dependency.
  7. Complete the fields on the screen (see screenshot below) and click Create.
    Please note:
    • 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.
    • Destination directory is relative to the build directory. Do not use the absolute path to refer to the destination directory.

On this page:

Screenshot: Creating an artifact dependency



4 Comments

  1. Anonymous

    Hi there,

    I have a plan composed of two jobs/stages. The first stage creates a directory "foo" with a bunch of files and exposes them as an artifact (the entire foo directory is a single artifact). It is set up as a shared artifact, with the destination directory set to "artifacts". In the second stage, there is a task that attempts to do some work with this artifact.

    I am having trouble finding out where exactly Bamboo puts it. I have tried to access it in my second stage using this path:

    ${bamboo.build.working.directory}/artifacts/foo

    The documentation implies it should be in a destination directory relative to the build dir, or am I misunderstanding?

  2. Does Bamboo delete the existing target directory prior to copying artifacts over? this isn't clear from the documentation.

  3. Has anyone actually gotten this to work? I am trying to share Maven artifacts between Stages and I cannot get this to work. I have followed these directions to the letter. I am using Maven 3. Every time I run my plan, there are never any Maven artifacts produced. The artifacts that I have specified are produced. What gives?

  4. Anonymous

    I am new to bamboo and its entire concepts. a single job can produce many different files,so what should be done if I want to pack selective files only from a single job(like I want .zip of only exe's and that job is producing files of 2-3 kinds).or is it like that I have to organize jobs such that each one produce each kind of files ?

    Thanks in advance...