Search code examples
jenkins-pluginsjenkins-cli

Promote Jenkins build by copying archived file to shared folder


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.


Solution

  • 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\