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

don't create remote directory when there are no files to publish

    XMLWordPrintable

Details

    Description

      We have a general build pipeline script that is reused by all our projects. It publishes some files to a documentation server with the sshPublisher step. But some projects don't have any documentation, and I would like to have no empty directory created for that project in that case.

      We see the following:

      SSH: Connecting from host [dc45dd1bbce5]
      SSH: Connecting with configuration [doc.cbss.inet] ...
      SSH: Disconnecting configuration [doc.cbss.inet] ...
      SSH: Transferred 0 file(s)
      

      So no files are transferred, but the configured remoteDirectory is still created, as specified in the documentation:

      remoteDirectory: Optional destination folder.
      This folder will be below the one in the global configuration, if present.
      The folder will be created if does not exist.

      I tried to specify makeEmptyDirs = false but that has no effect. I don't think that setting applies to the remoteDirectory.

      Attachments

        Activity

          jpraet Jimmy Praet created issue -
          jpraet Jimmy Praet added a comment -

          As a workaround I added

          execCommand: "rmdir -p --ignore-fail-on-non-empty ${remoteDirectory}"

          jpraet Jimmy Praet added a comment - As a workaround I added execCommand: "rmdir -p --ignore-fail-on-non-empty ${remoteDirectory}"

          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/84
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-61587%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/84 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-61587%22 (Note: this is an automated bulk comment)

          Closing ticket, please use the corresponding Github Issue as linked above.

          gmcdonald Gavin McDonald added a comment - Closing ticket, please use the corresponding Github Issue as linked above.
          gmcdonald Gavin McDonald made changes -
          Field Original Value New Value
          Resolution Incomplete [ 4 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            Unassigned Unassigned
            jpraet Jimmy Praet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: