The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
copyArtifacts
: Copy artifacts from another projectprojectName
The name of the project to copy artifacts from.
Artifacts from all modules will be copied. Enter JOBNAME/MODULENAME here to copy from a particular module; you may copy/paste this from the URL for that module when browsing Jenkins.
Example: MyMavenJob/my.group$MyModule
Artifacts from all configurations will be copied, each into a subdirectory with the name of the configuration as seen in its URL when browsing Jenkins.
Example: If the target directory is given as fromMatrix then the copy could create $WORKSPACE/fromMatrix/label=agentA/dist/mybuild.jar and $WORKSPACE/fromMatrix/label=agentB/dist/mybuild.jar.
To copy from a particular configuration, enter JOBNAME/AXIS=VALUE,.. as seen in the URL for that configuration.
Example: MyMatrixJob/jdk=Java6u17
To copy artifacts from one matrix project to another, use a parameter to select the matching configuration in the source project.
Example: OtherMatrixJob/jdk=$jdk
Use a path consisting of the project name followed by the branch name.
Example: /MyMultibranchProject/MyBranch
Special letters like '/' in branch names should be escaped. You can see the exact name in "Full project name" in job pages of each branch.
Example: ../MyMultibranchProject/feature%2Fnavigation
See the wiki page "How to reference another project by name" for more information.
String
excludes
(optional)
String
filter
(optional)
String
fingerprintArtifacts
(optional)
boolean
flatten
(optional)
boolean
optional
(optional)
boolean
parameters
(optional)
Jobs may be filtered to select only builds matching particular parameters or other build variables. Use PARAM=VALUE,... to list the parameter filter; this is the same syntax as described for multiconfiguration jobs in Project name except with parameters instead of axis values. For example, FOO=bar,BAZ=true examines only builds that ran with parameter FOO set to bar and the checkbox for BAZ was checked.
You shouldn't use "Build selector for Copy Artifact" parameters here, as it doesn't preserve compatibility when you upgrade plugins, and doesn't work for builds built before upgrading.
String
resultVariableSuffix
(optional)
If not specified, the source project name will be used instead (in all uppercase, and sequences of characters other than A-Z replaced by a single underscore).
Example:
Source project name | Suffix to be used |
---|---|
Project-ABC | PROJECT_ABC |
tool1-release1.2 | TOOL_RELEASE_ |
String
selector
(optional)
downstream
upstreamProjectName
Copy artifacts from a build that is a downstream of a build of the specified project. You can use variable expressions.
Downstream builds are found using fingerprints of files. That is, a build that is triggered from a build isn't always considered downstream, but you need to fingerprint files used in builds to let Jenkins track them.
Note: "Downstream build of" is applicable only to AbstractProject based projects (both upstream and downstream projects).
String
upstreamBuildNumber
String
lastWithArtifacts
lastCompleted
$class: 'MultiJobBuildSelector'
buildParameter
parameterName
You can pass not only the parameter name, but also the parameter value itself. This is useful especially used with workflow-plugin.
String
permalink
id
String
$class: 'PromotedBuildSelector'
level
int
latestSavedBuild
specific
buildNumber
String
lastSuccessful
stable
(optional)
boolean
upstream
allowUpstreamDependencies
(optional)
boolean
fallbackToLastSuccessful
(optional)
boolean
upstreamFilterStrategy
(optional)
UseGlobalSetting
, UseOldest
, UseNewest
workspace
target
(optional)
String
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.