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:
- Navigate to the configuration pages for the job that will produce the artifact, as described on Configuring jobs.
- Click the Artifacts tab (see Configuring a job's build artifacts).
- Click Edit for the artifact that you want to share. The artifact definition will be displayed.
- Select the Shared check box and then click Save.
- 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.
- 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.
Screenshot: Creating an artifact dependency