Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30428

Would like to use CopyArtifact to drive other actions

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      CopyArtifact works great for it's primary function. However, if you're trying to work toward avoiding actually using jenkins artifact copying/transfer code (due to it being slow or wanting to avoid data IO from the master) - it isn't directly useful.

      What I'd be very interested in would be some way to leverage the plugin for it's upstream project detection/file analysis/etc - but not actually do the copying.

      Here's two things that I believe would be easy improvements that would allow it to be used this way:

      1. Add a checkbox to the build step: "Detect only, do not copy file."
      2. Add an additional environment variable COPYARTIFACT_BUILD_PROJECT_%s functioning equivalently to the COPYARTIFACT_BUILD_NUMBER_%s except providing the name of the upstream project that was pulled from.

      The combination of these two would allow using all of CopyArtifact's detection/etc. functions, but I could instead hook in a shell build step and use the environment variables to more efficiently transfer the files, including options like leveraging a local cache/etc.

      I think it would be great to go beyond this and have a plugin that could get info about the upstream build, contents, etc. and make it available to the current build, but that's a bit too off-topic I think for this plugin.

        Attachments

          Activity

          Hide
          ikedam ikedam added a comment -
          Show
          ikedam ikedam added a comment - Run Selector plugin is now available. https://wiki.jenkins.io/pages/viewpage.action?pageId=99451238
          Hide
          timblaktu Tim Black added a comment - - edited

          In surveying the multitudes of issues tracking Jenkins' poor IO performance moving artifacts around, none of them have been properly resolved, and this remains an issue in 2021. This issue here is the kindest of them all, and perhaps the best candidate for actually getting done.

          UPDATE: I decided to just write a shared library function that scp's the artifacts from the controller to the agent. I ended up finding the code in Jenkins branch-api plugin that's creating that branch path segment (theĀ NameMangler), however it turned out to be completely unnecessary since I can just get the build directory (to construct the path to the artifacts on the controller) from the project/job object, obtained by name from the jenkins instance in groovy. So my shared library function is even simpler now, works for any project type and safer because it doesn't need to use any core or plug in classes.

          Show
          timblaktu Tim Black added a comment - - edited In surveying the multitudes of issues tracking Jenkins' poor IO performance moving artifacts around, none of them have been properly resolved, and this remains an issue in 2021. This issue here is the kindest of them all, and perhaps the best candidate for actually getting done. UPDATE: I decided to just write a shared library function that scp's the artifacts from the controller to the agent. I ended up finding the code in Jenkins branch-api plugin that's creating that branch path segment (theĀ  NameMangler ), however it turned out to be completely unnecessary since I can just get the build directory (to construct the path to the artifacts on the controller) from the project/job object, obtained by name from the jenkins instance in groovy. So my shared library function is even simpler now, works for any project type and safer because it doesn't need to use any core or plug in classes.

            People

            Assignee:
            nneul Nathan Neulinger
            Reporter:
            nneul Nathan Neulinger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: