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

Publish over ssh with flatten creates empty directory

    XMLWordPrintable

Details

    Description

      If the source file selection returns no files then when flatten is specified an empty target directory is created. If flatten is not specified then no target directory is created when no files are selected.

      Some of my builds only produce some artifacts for release builds and I copy these to separate locations with the publish-over-ssh. It gets very cluttered if the empty directories get produced for each non-release build.

      I have a patch (pull request coming soon) that adds unit tests to show the behaviour with and without flatten specified. It also tweaks the flatten case to not produce the empty folders.

      I'm not sure if anyone depends on empty folders being produced but if necessary I'll gladly update the patch to make it a configurable option to either suppress or force empty base folders.

      Attachments

        Activity

          Code changed in jenkins
          User: Richard Mortimer
          Path:
          src/main/java/jenkins/plugins/publish_over/BPTransfer.java
          src/test/java/jenkins/plugins/publish_over/BPTransferTest.java
          http://jenkins-ci.org/commit/publish-over-plugin/ad1c610c6cd0fd3b01ad81a7549418d449f9291c
          Log:
          JENKINS-10599 Publish over ssh with flatten creates empty directory
          Only create the target directory when the first file is copied.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: src/main/java/jenkins/plugins/publish_over/BPTransfer.java src/test/java/jenkins/plugins/publish_over/BPTransferTest.java http://jenkins-ci.org/commit/publish-over-plugin/ad1c610c6cd0fd3b01ad81a7549418d449f9291c Log: JENKINS-10599 Publish over ssh with flatten creates empty directory Only create the target directory when the first file is copied.

          Integrated in publish-over-ssh version 1.3

          Tested all seems to be working as expected.

          oldelvet Richard Mortimer added a comment - Integrated in publish-over-ssh version 1.3 Tested all seems to be working as expected.

          For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues

          Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/231
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-10599%22

          (Note: this is an automated bulk comment)

          gmcdonald Gavin McDonald added a comment - For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/231 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-10599%22 (Note: this is an automated bulk comment)

          People

            oldelvet Richard Mortimer
            oldelvet Richard Mortimer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: