Adding nexus-artifact-uploader plugin
In order to manage the nexus-artifact-uploader plugin this new builder is introduced Change-Id: Iac717214f560e836190b4821ee4bed1a89f1a594
This commit is contained in:
parent
0ece25ced4
commit
beef17f4de
@ -3621,3 +3621,59 @@ def build_name_setter(registry, xml_parent, data):
|
||||
]
|
||||
convert_mapping_to_xml(
|
||||
build_name_setter, data, mapping, fail_required=True)
|
||||
|
||||
|
||||
def nexus_artifact_uploader(registry, xml_parent, data):
|
||||
"""yaml: nexus-artifact-uploader
|
||||
To upload result of a build as an artifact in Nexus without the need of
|
||||
Maven. Requires the Jenkins :nexus-artifact-uploader:
|
||||
`Nexus Artifact Uploader Plugin <Nexus+Artifact+Uploader>`.
|
||||
|
||||
:arg str protocol: Protocol to use to connect to Nexus (default https)
|
||||
:arg str nexus_url: Nexus url (without protocol) (default '')
|
||||
:arg str nexus_user: Username to upload artifact to Nexus (default '')
|
||||
:arg str nexus_password: Password to upload artifact to Nexus
|
||||
(default '')
|
||||
:arg str group_id: GroupId to set for the artifact to upload
|
||||
(default '')
|
||||
:arg str artifact_id: ArtifactId to set for the artifact to upload
|
||||
(default '')
|
||||
:arg str version: Version to set for the artifact to upload
|
||||
(default '')
|
||||
:arg str packaging: Packaging to set for the artifact to upload
|
||||
(default '')
|
||||
:arg str type: Type to set for the artifact to upload (default '')
|
||||
:arg str classifier: Classifier to set for the artifact to upload
|
||||
(default '')
|
||||
:arg str repository: In which repository to upload the artifact
|
||||
(default '')
|
||||
:arg str file: File which will be the uploaded artifact (default '')
|
||||
:arg str credentials_id: Credentials to use (instead of password)
|
||||
(default '')
|
||||
|
||||
File Example:
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/builders/fixtures/nexus-artifact-uploader.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
nexus_artifact_uploader = XML.SubElement(
|
||||
xml_parent,
|
||||
'sp.sd.nexusartifactuploader.NexusArtifactUploader')
|
||||
mapping = [
|
||||
('protocol', 'protocol', 'https'),
|
||||
('nexus_url', 'nexusUrl', ''),
|
||||
('nexus_user', 'nexusUser', ''),
|
||||
('nexus_password', 'nexusPassword', ''),
|
||||
('group_id', 'groupId', ''),
|
||||
('artifact_id', 'artifactId', ''),
|
||||
('version', 'version', ''),
|
||||
('packaging', 'packaging', ''),
|
||||
('type', 'type', ''),
|
||||
('classifier', 'classifier', ''),
|
||||
('repository', 'repository', ''),
|
||||
('file', 'file', ''),
|
||||
('credentials_id', 'credentialsId', ''),
|
||||
]
|
||||
convert_mapping_to_xml(
|
||||
nexus_artifact_uploader, data, mapping, fail_required=True)
|
||||
|
20
tests/builders/fixtures/nexus_artifact_uploader001.xml
Normal file
20
tests/builders/fixtures/nexus_artifact_uploader001.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<sp.sd.nexusartifactuploader.NexusArtifactUploader>
|
||||
<protocol>https</protocol>
|
||||
<nexusUrl>nexus.org</nexusUrl>
|
||||
<nexusUser/>
|
||||
<nexusPassword/>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>artifact</artifactId>
|
||||
<version>1.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<type>zip</type>
|
||||
<classifier/>
|
||||
<repository>my-hosted-repo</repository>
|
||||
<file>/var/lib/jenkins/workspace/my_job/result.zip</file>
|
||||
<credentialsId/>
|
||||
</sp.sd.nexusartifactuploader.NexusArtifactUploader>
|
||||
</builders>
|
||||
</project>
|
10
tests/builders/fixtures/nexus_artifact_uploader001.yaml
Normal file
10
tests/builders/fixtures/nexus_artifact_uploader001.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
builders:
|
||||
- nexus-artifact-uploader:
|
||||
nexus_url: 'nexus.org'
|
||||
group_id: 'com.example'
|
||||
artifact_id: 'artifact'
|
||||
version: '1.0'
|
||||
packaging: 'pom'
|
||||
type: 'zip'
|
||||
repository: 'my-hosted-repo'
|
||||
file: '/var/lib/jenkins/workspace/my_job/result.zip'
|
Loading…
x
Reference in New Issue
Block a user