summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jenkins_jobs/modules/properties.py11
-rw-r--r--tests/properties/fixtures/docker-container-full.xml4
-rw-r--r--tests/properties/fixtures/docker-container-full.yaml2
-rw-r--r--tests/properties/fixtures/docker-container-minimal.xml4
-rw-r--r--tests/properties/fixtures/docker-container-nondefault.xml4
5 files changed, 25 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py
index a3dded2..2d6d468 100644
--- a/jenkins_jobs/modules/properties.py
+++ b/jenkins_jobs/modules/properties.py
@@ -1100,6 +1100,9 @@ def docker_container(registry, xml_parent, data):
1100 """yaml: docker-container 1100 """yaml: docker-container
1101 Requires the Jenkins: :jenkins-wiki:`Docker Plugin<Docker+Plugin>`. 1101 Requires the Jenkins: :jenkins-wiki:`Docker Plugin<Docker+Plugin>`.
1102 1102
1103 :arg str docker-registry-url: URL of the Docker registry. (default '')
1104 :arg str credentials-id: Credentials Id for the Docker registey.
1105 (default '')
1103 :arg bool commit-on-success: When a job completes, the docker slave 1106 :arg bool commit-on-success: When a job completes, the docker slave
1104 instance is committed with repository based on the job name and build 1107 instance is committed with repository based on the job name and build
1105 number as tag. (default false) 1108 number as tag. (default false)
@@ -1125,6 +1128,14 @@ def docker_container(registry, xml_parent, data):
1125 xml_docker = XML.SubElement( 1128 xml_docker = XML.SubElement(
1126 xml_parent, 'com.nirima.jenkins.plugins.docker.DockerJobProperty') 1129 xml_parent, 'com.nirima.jenkins.plugins.docker.DockerJobProperty')
1127 1130
1131 registry = XML.SubElement(xml_docker, 'registry')
1132 registry.set('plugin', 'docker-commons')
1133 registry_mapping = [
1134 ('docker-registry-url', 'url', ''),
1135 ('credentials-id', 'credentialsId', ''),
1136 ]
1137 helpers.convert_mapping_to_xml(
1138 registry, data, registry_mapping, fail_required=False)
1128 mapping = [ 1139 mapping = [
1129 ('commit-on-success', 'tagOnCompletion', False), 1140 ('commit-on-success', 'tagOnCompletion', False),
1130 ('additional-tag', 'additionalTag', ''), 1141 ('additional-tag', 'additionalTag', ''),
diff --git a/tests/properties/fixtures/docker-container-full.xml b/tests/properties/fixtures/docker-container-full.xml
index a537467..36a6715 100644
--- a/tests/properties/fixtures/docker-container-full.xml
+++ b/tests/properties/fixtures/docker-container-full.xml
@@ -2,6 +2,10 @@
2<project> 2<project>
3 <properties> 3 <properties>
4 <com.nirima.jenkins.plugins.docker.DockerJobProperty> 4 <com.nirima.jenkins.plugins.docker.DockerJobProperty>
5 <registry plugin="docker-commons">
6 <url>https://index.docker.io/v1/</url>
7 <credentialsId>71e4f29c-162b-40d0-85d9-3ddfba2911a0</credentialsId>
8 </registry>
5 <tagOnCompletion>true</tagOnCompletion> 9 <tagOnCompletion>true</tagOnCompletion>
6 <additionalTag>latest</additionalTag> 10 <additionalTag>latest</additionalTag>
7 <pushOnSuccess>true</pushOnSuccess> 11 <pushOnSuccess>true</pushOnSuccess>
diff --git a/tests/properties/fixtures/docker-container-full.yaml b/tests/properties/fixtures/docker-container-full.yaml
index b230e1b..c188ced 100644
--- a/tests/properties/fixtures/docker-container-full.yaml
+++ b/tests/properties/fixtures/docker-container-full.yaml
@@ -4,3 +4,5 @@ properties:
4 additional-tag: latest 4 additional-tag: latest
5 push-on-success: true 5 push-on-success: true
6 clean-local-images: true 6 clean-local-images: true
7 docker-registry-url: https://index.docker.io/v1/
8 credentials-id: 71e4f29c-162b-40d0-85d9-3ddfba2911a0
diff --git a/tests/properties/fixtures/docker-container-minimal.xml b/tests/properties/fixtures/docker-container-minimal.xml
index 756a7cc..ebb49d7 100644
--- a/tests/properties/fixtures/docker-container-minimal.xml
+++ b/tests/properties/fixtures/docker-container-minimal.xml
@@ -2,6 +2,10 @@
2<project> 2<project>
3 <properties> 3 <properties>
4 <com.nirima.jenkins.plugins.docker.DockerJobProperty> 4 <com.nirima.jenkins.plugins.docker.DockerJobProperty>
5 <registry plugin="docker-commons">
6 <url/>
7 <credentialsId/>
8 </registry>
5 <tagOnCompletion>false</tagOnCompletion> 9 <tagOnCompletion>false</tagOnCompletion>
6 <additionalTag/> 10 <additionalTag/>
7 <pushOnSuccess>false</pushOnSuccess> 11 <pushOnSuccess>false</pushOnSuccess>
diff --git a/tests/properties/fixtures/docker-container-nondefault.xml b/tests/properties/fixtures/docker-container-nondefault.xml
index e667466..d5e1d62 100644
--- a/tests/properties/fixtures/docker-container-nondefault.xml
+++ b/tests/properties/fixtures/docker-container-nondefault.xml
@@ -2,6 +2,10 @@
2<project> 2<project>
3 <properties> 3 <properties>
4 <com.nirima.jenkins.plugins.docker.DockerJobProperty> 4 <com.nirima.jenkins.plugins.docker.DockerJobProperty>
5 <registry plugin="docker-commons">
6 <url/>
7 <credentialsId/>
8 </registry>
5 <tagOnCompletion>true</tagOnCompletion> 9 <tagOnCompletion>true</tagOnCompletion>
6 <additionalTag>my-hands-are-typing-words</additionalTag> 10 <additionalTag>my-hands-are-typing-words</additionalTag>
7 <pushOnSuccess>true</pushOnSuccess> 11 <pushOnSuccess>true</pushOnSuccess>