1

That seems a very intuitive step to do but I have a issue with that.We have a build that contains some archived files. Let’s say, we would like to promote it and copy the artifact saved in this build to some shared storage location. So we are using a promote plugin that is exactly what we need but there is NO option to use a "parent" job archived files. I tried to use "copy artifact from another project" but I cannot pass a build number of a "parent" build.
What do I miss?

P.S. We cannot use “Publish Over” plugin since it expose all Jenkins users our shared folders and enables all users to copy files there.

Dima Kreisserman
  • 663
  • 1
  • 13
  • 33

2 Answers2

1

I'm not sure i understood right when you say

I tried to use "copy artifact from another project" but I cannot pass a build number of a "parent" build."

But possibly it could help, with these variables you can retrieve information from the parent job: Retrieve build number or artifacts of downstream build in Jenkins

Moreover, you can try this one too: https://wiki.jenkins.io/display/JENKINS/Copy+Artifact+Plugin

It permit you to finger print artefact and than copy them, i used in the past and it works pretty good!

Hope it helps

ivoruJavaBoy
  • 1,307
  • 2
  • 19
  • 39
  • I've tried to use a "Copy+Artifact+Plugin" but how to you pass a "Which Build" parameter? It suppose to be a parent build number. I tried to select "Upstream build that triggered this job" but it fails on "Unable to find a build..." – Dima Kreisserman Nov 07 '17 at 11:21
  • That's strange, the variable is just valued with the upstream job if it parametrized, by the way, looks like you solved! Happy if i helped :) – ivoruJavaBoy Nov 07 '17 at 12:09
1

Here I found a lead to my solution: Jenkins: Use Archived Artifact in Promoted Build

Within the "Copy Artifact Plugin":

Project name: "my parent job name" (somehow, ${PROMOTED_JOB_NAME} refuses to work)  
Which build: Specific build  
Build number: ${PROMOTED_NUMBER}  
Artifact to copy: empty  
Artifact not to copy: empty  
Target directory: \\my_shared_folder\
Dima Kreisserman
  • 663
  • 1
  • 13
  • 33