[JIRA] (JENKINS-61587) don't create remote directory when there are no files to publish

3 views
Skip to first unread message

jimmy.praet@telenet.be (JIRA)

unread,
Mar 19, 2020, 10:10:16 AM3/19/20
to jenkinsc...@googlegroups.com
Jimmy Praet created an issue
 
Jenkins / Improvement JENKINS-61587
don't create remote directory when there are no files to publish
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: publish-over-ssh-plugin
Created: 2020-03-19 14:09
Priority: Minor Minor
Reporter: Jimmy Praet

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.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

jimmy.praet@telenet.be (JIRA)

unread,
Mar 19, 2020, 10:11:02 AM3/19/20
to jenkinsc...@googlegroups.com

jimmy.praet@telenet.be (JIRA)

unread,
Mar 20, 2020, 5:36:04 AM3/20/20
to jenkinsc...@googlegroups.com
Jimmy Praet commented on Improvement JENKINS-61587
 
Re: don't create remote directory when there are no files to publish

As a workaround I added

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

Reply all
Reply to author
Forward
0 new messages