Update Google Cloud Storage publisher

https://github.com/jenkinsci/google-storage-plugin/pull/12 added an
option to allow uploaded objects (such as the build log) to be viewed
inline in web browsers, rather than forcing them to be downloaded.

This commit adds support for this option.

Change-Id: Iae09db42d2c2f69add31f9de7819a22fe1cc1c6e
This commit is contained in:
Jeff Grafton 2016-04-25 17:10:03 -07:00
parent 915a36f449
commit d7c6fd8ea8
4 changed files with 21 additions and 0 deletions

View File

@ -5193,6 +5193,9 @@ def google_cloud_storage(parser, xml_parent, data):
share uploaded artifacts with everyone (default false)
* **upload-for-failed-jobs** (`bool`) whether to upload
artifacts even if the build fails (default false)
* **show-inline** (`bool`) whether to show uploaded build
log inline in web browsers, rather than forcing it to be
downloaded (default true)
* **strip-prefix** (`str`) strip this prefix off the
file names (default: not set)
@ -5206,6 +5209,9 @@ def google_cloud_storage(parser, xml_parent, data):
share uploaded artifacts with everyone (default false)
* **upload-for-failed-jobs** (`bool`) whether to upload
artifacts even if the build fails (default false)
* **show-inline** (`bool`) whether to show uploaded
artifacts inline in web browsers, rather than forcing
them to be downloaded (default false)
* **strip-prefix** (`str`) strip this prefix off the
file names (default: not set)
@ -5268,6 +5274,9 @@ def google_cloud_storage(parser, xml_parent, data):
XML.SubElement(xml_element, 'forFailedJobs').text = str(
properties.get('upload-for-failed-jobs', False)).lower()
XML.SubElement(xml_element, 'showInline').text = str(
properties.get('show-inline', True)).lower()
XML.SubElement(xml_element, 'pathPrefix').text = str(
properties.get('strip-prefix', ''))
@ -5301,6 +5310,9 @@ def google_cloud_storage(parser, xml_parent, data):
XML.SubElement(xml_element, 'forFailedJobs').text = str(
properties.get('upload-for-failed-jobs', False)).lower()
XML.SubElement(xml_element, 'showInline').text = str(
properties.get('show-inline', False)).lower()
XML.SubElement(xml_element, 'pathPrefix').text = str(
properties.get('strip-prefix', ''))

View File

@ -15,6 +15,7 @@
<bucketNameWithVars>gs://myBucket</bucketNameWithVars>
<sharedPublicly>true</sharedPublicly>
<forFailedJobs>true</forFailedJobs>
<showInline>true</showInline>
<pathPrefix/>
<module/>
<logName>console.log</logName>
@ -23,6 +24,7 @@
<bucketNameWithVars>gs://myBucket</bucketNameWithVars>
<sharedPublicly>false</sharedPublicly>
<forFailedJobs>true</forFailedJobs>
<showInline>false</showInline>
<pathPrefix/>
<module/>
<sourceGlobWithVars>target/*.war</sourceGlobWithVars>
@ -31,6 +33,7 @@
<bucketNameWithVars>gs://myBucket/artifacts/</bucketNameWithVars>
<sharedPublicly>true</sharedPublicly>
<forFailedJobs>false</forFailedJobs>
<showInline>false</showInline>
<pathPrefix>path/to/</pathPrefix>
<module reference="../../com.google.jenkins.plugins.storage.ClassicUpload/module"/>
<sourceGlobWithVars>**/build/*.iso</sourceGlobWithVars>

View File

@ -15,6 +15,7 @@
<bucketNameWithVars>gs://myBucket</bucketNameWithVars>
<sharedPublicly>true</sharedPublicly>
<forFailedJobs>true</forFailedJobs>
<showInline>false</showInline>
<pathPrefix>path/to/</pathPrefix>
<module/>
<logName>console.log</logName>
@ -23,6 +24,7 @@
<bucketNameWithVars>gs://myBucket</bucketNameWithVars>
<sharedPublicly>false</sharedPublicly>
<forFailedJobs>false</forFailedJobs>
<showInline>false</showInline>
<pathPrefix>path/to/</pathPrefix>
<module/>
<sourceGlobWithVars>target/*.war</sourceGlobWithVars>
@ -38,6 +40,7 @@
<bucketNameWithVars>gs://myBucket/artifacts/</bucketNameWithVars>
<sharedPublicly>false</sharedPublicly>
<forFailedJobs>false</forFailedJobs>
<showInline>true</showInline>
<pathPrefix>path/to/</pathPrefix>
<module reference="../../com.google.jenkins.plugins.storage.StdoutUpload/module"/>
<logName>console.log</logName>
@ -46,6 +49,7 @@
<bucketNameWithVars>gs://myBucket/artifacts/</bucketNameWithVars>
<sharedPublicly>true</sharedPublicly>
<forFailedJobs>true</forFailedJobs>
<showInline>true</showInline>
<pathPrefix>path/to/</pathPrefix>
<module reference="../../com.google.jenkins.plugins.storage.ClassicUpload/module"/>
<sourceGlobWithVars>target/*.war</sourceGlobWithVars>

View File

@ -10,6 +10,7 @@ publishers:
storage-location: 'gs://myBucket'
share-publicly: 'true'
upload-for-failed-jobs: 'true'
show-inline: 'false'
strip-prefix: 'path/to/'
- classic:
file-pattern: 'target/*.war'
@ -27,4 +28,5 @@ publishers:
storage-location: 'gs://myBucket/artifacts/'
share-publicly: 'true'
upload-for-failed-jobs: 'true'
show-inline: 'true'
strip-prefix: 'path/to/'