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

Artifact Deployer doesn't delete artifacts when used in combination with Flexible Publisher

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 1.532.3
      Artifact Deployer Plugin 0.29
      Windows 7 x64 OS

      When using the Artifact Deployer plugin in combination with the Flexible Publisher plugin to conditionally publish artifacts under specific conditions, the option to have the artifact deployer purge the deployed artifacts when a build is deleted no longer works. For example, in a very trivial example you can reproduce this as follows:

      • Create a new job of type 'freestyle'
      • create a file as part of the build operation. Doing a simple "echo > test.txt" should suffice.
      • configure a post build step using the Flexible Publish plugin
      • configure the flexible publisher with a run condition of "Always" so the conditional action is always executed
      • configure the conditional action to use the Artifact Deployer plugin
      • configure the artifact deployer to publish the test file, test.txt in this example, so a remote location, say c:\temp
      • make sure to enable the option to "Delete remote artifacts when the build is deleted"
      • save your changes and execute a build and confirm that the test file is correctly published
      • now select this build from the Jenkins dashboard and delete it - confirm that the published test file still exists and has not been purged

      The expected behavior in this scenario would seem obvious - the published artifact(s) should be purged as they would normally be had the job not been using the flexible publisher.

          [JENKINS-26109] Artifact Deployer doesn't delete artifacts when used in combination with Flexible Publisher

          NOTE: While doing some ad-hoc testing to reduce this bug to the most basic use case I noticed something even stranger about the play between these two plugins. If you have two post-build operations, one using a typical artifact deployer configuration (ie: with no conditions on it) and another one that combines both to conditionally deploy other artifacts, when you go back to delete the test build neither of the artifacts gets purged.

          However, if you take the job exactly as-is and simply remove the post-build step that uses the Flexible Publisher, then the other step that does a simple artifact deployment does work as expected. It's almost as if as soon as the job encounters an instance of the flexible publisher anywhere in the post-build steps, it affects the behavior of the artifact deployer - whether it actually uses the flexible publish or not.

          Kevin Phillips added a comment - NOTE: While doing some ad-hoc testing to reduce this bug to the most basic use case I noticed something even stranger about the play between these two plugins. If you have two post-build operations, one using a typical artifact deployer configuration (ie: with no conditions on it) and another one that combines both to conditionally deploy other artifacts, when you go back to delete the test build neither of the artifacts gets purged. However, if you take the job exactly as-is and simply remove the post-build step that uses the Flexible Publisher, then the other step that does a simple artifact deployment does work as expected. It's almost as if as soon as the job encounters an instance of the flexible publisher anywhere in the post-build steps, it affects the behavior of the artifact deployer - whether it actually uses the flexible publish or not.

          NOTE: The same results can be reproduced when using the artifact deployer as a 'build' step instead of a post-build step, when used in conjunction with the 'conditional build step' plugin.

          Kevin Phillips added a comment - NOTE: The same results can be reproduced when using the artifact deployer as a 'build' step instead of a post-build step, when used in conjunction with the 'conditional build step' plugin.

            gbois Gregory Boissinot
            leedega Kevin Phillips
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: