Allow control of verbose option for publish-over plugins
The publish-over plugins all expose the option 'verbose' to all for lots of debug output from the connection to be outputted to the jenkins console. However by default this is supposed to be disabled ('false') so update the existing code to switch to the correct behaviour. Change-Id: Ie9acb1a005a25cd5c9f279cc89d5178eb8d54dd7
This commit is contained in:
parent
9f5fc4af8b
commit
de4fb862f3
@ -1159,24 +1159,31 @@ def ftp(registry, xml_parent, data):
|
||||
Requires the Jenkins :jenkins-wiki:`Publish over FTP Plugin
|
||||
<Publish+Over+FTP+Plugin>`.
|
||||
|
||||
:arg str site: name of the ftp site
|
||||
:arg str target: destination directory
|
||||
:arg str site: name of the ftp site (required)
|
||||
:arg str target: destination directory (required)
|
||||
:arg bool target-is-date-format: whether target is a date format. If true,
|
||||
raw text should be quoted (default false)
|
||||
:arg bool clean-remote: should the remote directory be deleted before
|
||||
transferring files (default false)
|
||||
:arg str source: source path specifier
|
||||
:arg str source: source path specifier (required)
|
||||
:arg str excludes: excluded file pattern (optional)
|
||||
:arg str remove-prefix: prefix to remove from uploaded file paths
|
||||
(optional)
|
||||
:arg bool fail-on-error: fail the build if an error occurs (default false).
|
||||
:arg bool flatten: only create files on the server, don't create
|
||||
directories (default false).
|
||||
:arg bool verbose: adds lots of detail useful for debug to the console
|
||||
but generally should be left off (default false)
|
||||
|
||||
Example:
|
||||
Minimal Example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/ftp001.yaml
|
||||
:language: yaml
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/ftp-minimal.yaml
|
||||
:language: yaml
|
||||
|
||||
Full Example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/ftp-full.yaml
|
||||
:language: yaml
|
||||
|
||||
"""
|
||||
console_prefix = 'FTP: '
|
||||
@ -1906,11 +1913,18 @@ def ssh(registry, xml_parent, data):
|
||||
before being sent to the remote server (defaults false)
|
||||
:arg bool flatten: only create files on the server, don't create
|
||||
directories (default false).
|
||||
:arg bool verbose: adds lots of detail useful for debug to the console
|
||||
but generally should be left off (default false)
|
||||
|
||||
Example:
|
||||
Minimal Example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/ssh001.yaml
|
||||
:language: yaml
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/ssh-minimal.yaml
|
||||
:language: yaml
|
||||
|
||||
Full Example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/ssh-full.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
console_prefix = 'SSH: '
|
||||
tag_prefix = 'jenkins.plugins.publish'
|
||||
@ -2674,7 +2688,8 @@ def base_publish_over(xml_parent, data, console_prefix,
|
||||
|
||||
inner = XML.SubElement(publishers, publisher_tag)
|
||||
XML.SubElement(inner, 'configName').text = data['site']
|
||||
XML.SubElement(inner, 'verbose').text = 'true'
|
||||
XML.SubElement(inner, 'verbose').text = str(
|
||||
data.get('verbose', False)).lower()
|
||||
|
||||
transfers = XML.SubElement(inner, 'transfers')
|
||||
transfersset = XML.SubElement(transfers, transferset_tag)
|
||||
@ -2732,10 +2747,17 @@ def cifs(registry, xml_parent, data):
|
||||
:arg bool fail-on-error: fail the build if an error occurs (default false).
|
||||
:arg bool flatten: only create files on the server, don't create
|
||||
directories (default false).
|
||||
:arg bool verbose: adds lots of detail useful for debug to the console
|
||||
but generally should be left off (default false)
|
||||
|
||||
Example:
|
||||
Minimal Example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/cifs001.yaml
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/cifs-minimal.yaml
|
||||
:language: yaml
|
||||
|
||||
Full Example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/cifs-full.yaml
|
||||
:language: yaml
|
||||
|
||||
"""
|
||||
|
@ -8,7 +8,7 @@
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__ssh.BapSshPublisher>
|
||||
<configName>server.example.com</configName>
|
||||
<verbose>true</verbose>
|
||||
<verbose>false</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__ssh.BapSshTransfer>
|
||||
<remoteDirectory>dest/dir</remoteDirectory>
|
||||
|
33
tests/publishers/fixtures/cifs-full.xml
Normal file
33
tests/publishers/fixtures/cifs-full.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__cifs.CifsPublisherPlugin>
|
||||
<consolePrefix>CIFS: </consolePrefix>
|
||||
<delegate>
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__cifs.CifsPublisher>
|
||||
<configName>cifs.share</configName>
|
||||
<verbose>true</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__cifs.CifsTransfer>
|
||||
<remoteDirectory>'dest/dir/'yyyyMMddHHmmss</remoteDirectory>
|
||||
<sourceFiles>base/source/dir/**</sourceFiles>
|
||||
<excludes>**/*.excludedfiletype</excludes>
|
||||
<removePrefix>base/source/dir</removePrefix>
|
||||
<remoteDirectorySDF>true</remoteDirectorySDF>
|
||||
<flatten>true</flatten>
|
||||
<cleanRemote>true</cleanRemote>
|
||||
</jenkins.plugins.publish__over__cifs.CifsTransfer>
|
||||
</transfers>
|
||||
<useWorkspaceInPromotion>false</useWorkspaceInPromotion>
|
||||
<usePromotionTimestamp>false</usePromotionTimestamp>
|
||||
</jenkins.plugins.publish__over__cifs.CifsPublisher>
|
||||
</publishers>
|
||||
<continueOnError>false</continueOnError>
|
||||
<failOnError>true</failOnError>
|
||||
<alwaysPublishFromMaster>false</alwaysPublishFromMaster>
|
||||
<hostConfigurationAccess class="jenkins.plugins.publish_over_cifs.CifsPublisherPlugin" reference="../.."/>
|
||||
</delegate>
|
||||
</jenkins.plugins.publish__over__cifs.CifsPublisherPlugin>
|
||||
</publishers>
|
||||
</project>
|
@ -1,8 +1,12 @@
|
||||
publishers:
|
||||
- cifs:
|
||||
site: 'cifs.share'
|
||||
target: 'dest/dir'
|
||||
target: "'dest/dir/'yyyyMMddHHmmss"
|
||||
target-is-date-format: true
|
||||
clean-remote: true
|
||||
source: 'base/source/dir/**'
|
||||
remove-prefix: 'base/source/dir'
|
||||
excludes: '**/*.excludedfiletype'
|
||||
remove-prefix: 'base/source/dir'
|
||||
fail-on-error: true
|
||||
flatten: true
|
||||
verbose: true
|
@ -7,15 +7,15 @@
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__cifs.CifsPublisher>
|
||||
<configName>cifs.share</configName>
|
||||
<verbose>true</verbose>
|
||||
<verbose>false</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__cifs.CifsTransfer>
|
||||
<remoteDirectory>dest/dir</remoteDirectory>
|
||||
<sourceFiles>base/source/dir/**</sourceFiles>
|
||||
<excludes>**/*.excludedfiletype</excludes>
|
||||
<removePrefix>base/source/dir</removePrefix>
|
||||
<excludes/>
|
||||
<removePrefix/>
|
||||
<remoteDirectorySDF>false</remoteDirectorySDF>
|
||||
<flatten>true</flatten>
|
||||
<flatten>false</flatten>
|
||||
<cleanRemote>false</cleanRemote>
|
||||
</jenkins.plugins.publish__over__cifs.CifsTransfer>
|
||||
</transfers>
|
5
tests/publishers/fixtures/cifs-minimal.yaml
Normal file
5
tests/publishers/fixtures/cifs-minimal.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
publishers:
|
||||
- cifs:
|
||||
site: 'cifs.share'
|
||||
target: 'dest/dir'
|
||||
source: 'base/source/dir/**'
|
34
tests/publishers/fixtures/ftp-full.xml
Normal file
34
tests/publishers/fixtures/ftp-full.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__ftp.BapFtpPublisherPlugin>
|
||||
<consolePrefix>FTP: </consolePrefix>
|
||||
<delegate>
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__ftp.BapFtpPublisher>
|
||||
<configName>ftp.example.com</configName>
|
||||
<verbose>true</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__ftp.BapFtpTransfer>
|
||||
<remoteDirectory>'dest/dir/'yyyyMMddHHmmss</remoteDirectory>
|
||||
<sourceFiles>base/source/dir/**</sourceFiles>
|
||||
<excludes>**/*.excludedfiletype</excludes>
|
||||
<removePrefix>base/source/dir</removePrefix>
|
||||
<remoteDirectorySDF>true</remoteDirectorySDF>
|
||||
<flatten>true</flatten>
|
||||
<cleanRemote>true</cleanRemote>
|
||||
<asciiMode>false</asciiMode>
|
||||
</jenkins.plugins.publish__over__ftp.BapFtpTransfer>
|
||||
</transfers>
|
||||
<useWorkspaceInPromotion>false</useWorkspaceInPromotion>
|
||||
<usePromotionTimestamp>false</usePromotionTimestamp>
|
||||
</jenkins.plugins.publish__over__ftp.BapFtpPublisher>
|
||||
</publishers>
|
||||
<continueOnError>false</continueOnError>
|
||||
<failOnError>true</failOnError>
|
||||
<alwaysPublishFromMaster>false</alwaysPublishFromMaster>
|
||||
<hostConfigurationAccess class="jenkins.plugins.publish_over_ftp.BapFtpPublisherPlugin" reference="../.."/>
|
||||
</delegate>
|
||||
</jenkins.plugins.publish__over__ftp.BapFtpPublisherPlugin>
|
||||
</publishers>
|
||||
</project>
|
12
tests/publishers/fixtures/ftp-full.yaml
Normal file
12
tests/publishers/fixtures/ftp-full.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
publishers:
|
||||
- ftp:
|
||||
site: 'ftp.example.com'
|
||||
target: "'dest/dir/'yyyyMMddHHmmss"
|
||||
target-is-date-format: true
|
||||
clean-remote: true
|
||||
source: 'base/source/dir/**'
|
||||
excludes: '**/*.excludedfiletype'
|
||||
remove-prefix: 'base/source/dir'
|
||||
fail-on-error: true
|
||||
flatten: true
|
||||
verbose: true
|
@ -7,15 +7,15 @@
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__ftp.BapFtpPublisher>
|
||||
<configName>ftp.example.com</configName>
|
||||
<verbose>true</verbose>
|
||||
<verbose>false</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__ftp.BapFtpTransfer>
|
||||
<remoteDirectory>dest/dir</remoteDirectory>
|
||||
<sourceFiles>base/source/dir/**</sourceFiles>
|
||||
<excludes>**/*.excludedfiletype</excludes>
|
||||
<removePrefix>base/source/dir</removePrefix>
|
||||
<excludes/>
|
||||
<removePrefix/>
|
||||
<remoteDirectorySDF>false</remoteDirectorySDF>
|
||||
<flatten>true</flatten>
|
||||
<flatten>false</flatten>
|
||||
<cleanRemote>false</cleanRemote>
|
||||
<asciiMode>false</asciiMode>
|
||||
</jenkins.plugins.publish__over__ftp.BapFtpTransfer>
|
5
tests/publishers/fixtures/ftp-minimal.yaml
Normal file
5
tests/publishers/fixtures/ftp-minimal.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
publishers:
|
||||
- ftp:
|
||||
site: 'ftp.example.com'
|
||||
target: 'dest/dir'
|
||||
source: 'base/source/dir/**'
|
@ -1,8 +0,0 @@
|
||||
publishers:
|
||||
- ftp:
|
||||
site: 'ftp.example.com'
|
||||
target: 'dest/dir'
|
||||
source: 'base/source/dir/**'
|
||||
remove-prefix: 'base/source/dir'
|
||||
excludes: '**/*.excludedfiletype'
|
||||
flatten: true
|
@ -10,13 +10,13 @@
|
||||
<verbose>true</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__ssh.BapSshTransfer>
|
||||
<remoteDirectory>dest/dir</remoteDirectory>
|
||||
<remoteDirectory>'dest/dir/'yyyyMMddHHmmss</remoteDirectory>
|
||||
<sourceFiles>base/source/dir/**</sourceFiles>
|
||||
<excludes>**/*.excludedfiletype</excludes>
|
||||
<removePrefix>base/source/dir</removePrefix>
|
||||
<remoteDirectorySDF>false</remoteDirectorySDF>
|
||||
<remoteDirectorySDF>true</remoteDirectorySDF>
|
||||
<flatten>true</flatten>
|
||||
<cleanRemote>false</cleanRemote>
|
||||
<cleanRemote>true</cleanRemote>
|
||||
<execCommand>rm -r jenkins_$BUILD_NUMBER</execCommand>
|
||||
<execTimeout>1800000</execTimeout>
|
||||
<usePty>true</usePty>
|
||||
@ -27,8 +27,8 @@
|
||||
</jenkins.plugins.publish__over__ssh.BapSshPublisher>
|
||||
</publishers>
|
||||
<continueOnError>false</continueOnError>
|
||||
<failOnError>false</failOnError>
|
||||
<alwaysPublishFromMaster>false</alwaysPublishFromMaster>
|
||||
<failOnError>true</failOnError>
|
||||
<alwaysPublishFromMaster>true</alwaysPublishFromMaster>
|
||||
<hostConfigurationAccess class="jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin" reference="../.."/>
|
||||
</delegate>
|
||||
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin>
|
@ -1,11 +1,16 @@
|
||||
publishers:
|
||||
- ssh:
|
||||
site: 'server.example.com'
|
||||
target: 'dest/dir'
|
||||
target: "'dest/dir/'yyyyMMddHHmmss"
|
||||
target-is-date-format: true
|
||||
clean-remote: true
|
||||
source: 'base/source/dir/**'
|
||||
remove-prefix: 'base/source/dir'
|
||||
excludes: '**/*.excludedfiletype'
|
||||
use-pty: true
|
||||
command: 'rm -r jenkins_$BUILD_NUMBER'
|
||||
timeout: 1800000
|
||||
use-pty: true
|
||||
excludes: '**/*.excludedfiletype'
|
||||
remove-prefix: 'base/source/dir'
|
||||
fail-on-error: true
|
||||
always-publish-from-master: true
|
||||
flatten: true
|
||||
verbose: true
|
33
tests/publishers/fixtures/ssh-minimal.xml
Normal file
33
tests/publishers/fixtures/ssh-minimal.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin>
|
||||
<consolePrefix>SSH: </consolePrefix>
|
||||
<delegate>
|
||||
<publishers>
|
||||
<jenkins.plugins.publish__over__ssh.BapSshPublisher>
|
||||
<configName>server.example.com</configName>
|
||||
<verbose>false</verbose>
|
||||
<transfers>
|
||||
<jenkins.plugins.publish__over__ssh.BapSshTransfer>
|
||||
<remoteDirectory>dest/dir/</remoteDirectory>
|
||||
<sourceFiles>base/source/dir/**</sourceFiles>
|
||||
<excludes/>
|
||||
<removePrefix/>
|
||||
<remoteDirectorySDF>false</remoteDirectorySDF>
|
||||
<flatten>false</flatten>
|
||||
<cleanRemote>false</cleanRemote>
|
||||
</jenkins.plugins.publish__over__ssh.BapSshTransfer>
|
||||
</transfers>
|
||||
<useWorkspaceInPromotion>false</useWorkspaceInPromotion>
|
||||
<usePromotionTimestamp>false</usePromotionTimestamp>
|
||||
</jenkins.plugins.publish__over__ssh.BapSshPublisher>
|
||||
</publishers>
|
||||
<continueOnError>false</continueOnError>
|
||||
<failOnError>false</failOnError>
|
||||
<alwaysPublishFromMaster>false</alwaysPublishFromMaster>
|
||||
<hostConfigurationAccess class="jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin" reference="../.."/>
|
||||
</delegate>
|
||||
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin>
|
||||
</publishers>
|
||||
</project>
|
5
tests/publishers/fixtures/ssh-minimal.yaml
Normal file
5
tests/publishers/fixtures/ssh-minimal.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
publishers:
|
||||
- ssh:
|
||||
site: 'server.example.com'
|
||||
target: 'dest/dir/'
|
||||
source: 'base/source/dir/**'
|
Loading…
Reference in New Issue
Block a user