Merge "Added support for JClouds Blobstore"

This commit is contained in:
Jenkins 2015-04-16 13:43:10 +00:00 committed by Gerrit Code Review
commit e1cc03e606
4 changed files with 70 additions and 0 deletions

View File

@ -100,6 +100,52 @@ def blame_upstream(parser, xml_parent, data):
'BlameUpstreamCommitersPublisher')
def jclouds(parser, xml_parent, data):
"""yaml: JClouds Cloud Storage Settings
provides a way to store artifacts on JClouds supported storage providers.
Requires the Jenkins `JClouds Plugin.
<https://wiki.jenkins-ci.org/display/JENKINS/JClouds+Plugin>`_
JClouds Cloud Storage Settings must be configured for the Jenkins instance.
:arg str profile: preconfigured storage profile (required)
:arg str files: files to upload (regex) (required)
:arg str basedir: the source file path (relative to workspace, Optional)
:arg str container: the destination container name (required)
:arg bool hierarchy: keep hierarchy (default false)
Example:
.. literalinclude:: /../../tests/publishers/fixtures/jclouds001.yaml
"""
deployer = XML.SubElement(xml_parent,
'jenkins.plugins.jclouds.blobstore.'
'BlobStorePublisher')
if 'profile' not in data:
raise JenkinsJobsException('profile parameter is missing')
XML.SubElement(deployer, 'profileName').text = data.get('profile')
entries = XML.SubElement(deployer, 'entries')
deployer_entry = XML.SubElement(entries,
'jenkins.plugins.jclouds.blobstore.'
'BlobStoreEntry')
try:
XML.SubElement(deployer_entry, 'container').text = data['container']
XML.SubElement(deployer_entry, 'path').text = data.get('basedir', '')
XML.SubElement(deployer_entry, 'sourceFile').text = data['files']
except KeyError as e:
raise JenkinsJobsException("blobstore requires '%s' to be set"
% e.args[0])
XML.SubElement(deployer_entry, 'keepHierarchy').text = str(
data.get('hierarchy', False)).lower()
def campfire(parser, xml_parent, data):
"""yaml: campfire
Send build notifications to Campfire rooms.

View File

@ -153,6 +153,7 @@ jenkins_jobs.publishers =
ircbot=jenkins_jobs.modules.publishers:ircbot
jabber=jenkins_jobs.modules.publishers:jabber
jacoco=jenkins_jobs.modules.publishers:jacoco
jclouds=jenkins_jobs.modules.publishers:jclouds
jira=jenkins_jobs.modules.publishers:jira
join-trigger=jenkins_jobs.modules.publishers:join_trigger
junit=jenkins_jobs.modules.publishers:junit

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<jenkins.plugins.jclouds.blobstore.BlobStorePublisher>
<profileName>hp</profileName>
<entries>
<jenkins.plugins.jclouds.blobstore.BlobStoreEntry>
<container>jenkins</container>
<path/>
<sourceFile>*.tar.gz</sourceFile>
<keepHierarchy>false</keepHierarchy>
</jenkins.plugins.jclouds.blobstore.BlobStoreEntry>
</entries>
</jenkins.plugins.jclouds.blobstore.BlobStorePublisher>
</publishers>
</project>

View File

@ -0,0 +1,6 @@
publishers:
- jclouds:
profile: hp
files: '*.tar.gz'
container: jenkins
basedir: