Browse Source

Merge "docker-build-publish: Improve support for new options"

tags/2.5.0
Zuul 10 months ago
parent
commit
22307f715f

+ 9
- 0
jenkins_jobs/modules/builders.py View File

@@ -3950,6 +3950,12 @@ def docker_build_publish(parse, xml_parent, data):
3950 3950
     :arg str file-path: Path of the Dockerfile. (default '')
3951 3951
     :arg str build-context: Project root path for the build, defaults to the
3952 3952
         workspace if not specified. (default '')
3953
+    :arg bool create-fingerprint: If enabled, the plugin will create
3954
+        fingerprints after the build of each image. (default false)
3955
+    :arg str build-args: Additional build arguments passed to
3956
+        docker build (default '')
3957
+    :arg bool force-tag: Force tag replacement when tag already
3958
+        exists (default false)
3953 3959
 
3954 3960
     Minimal example:
3955 3961
 
@@ -3974,6 +3980,9 @@ def docker_build_publish(parse, xml_parent, data):
3974 3980
         ('skip-push', 'skipPush', False),
3975 3981
         ('file-path', 'dockerfilePath', ''),
3976 3982
         ('build-context', 'buildContext', ''),
3983
+        ('create-fingerprint', 'createFingerprint', False),
3984
+        ('build-args', 'buildAdditionalArgs', ''),
3985
+        ('force-tag', 'forceTag', False),
3977 3986
     ]
3978 3987
     helpers.convert_mapping_to_xml(db, data, mapping, fail_required=True)
3979 3988
 

+ 3
- 0
tests/builders/fixtures/docker-builder001.xml View File

@@ -12,6 +12,9 @@
12 12
       <skipPush>false</skipPush>
13 13
       <dockerfilePath>/tmp/</dockerfilePath>
14 14
       <buildContext>/tmp/</buildContext>
15
+      <createFingerprint>true</createFingerprint>
16
+      <buildAdditionalArgs>--build-arg https_proxy=&quot;http://some.proxy:port&quot;</buildAdditionalArgs>
17
+      <forceTag>true</forceTag>
15 18
     </com.cloudbees.dockerpublish.DockerBuilder>
16 19
   </builders>
17 20
 </project>

+ 3
- 0
tests/builders/fixtures/docker-builder001.yaml View File

@@ -10,3 +10,6 @@ builders:
10 10
         skip-tag: false
11 11
         file-path: '/tmp/'
12 12
         build-context: '/tmp/'
13
+        create-fingerprint: true
14
+        build-args: --build-arg https_proxy="http://some.proxy:port"
15
+        force-tag: true

+ 3
- 0
tests/builders/fixtures/docker-builder002.xml View File

@@ -12,6 +12,9 @@
12 12
       <skipPush>false</skipPush>
13 13
       <dockerfilePath>/tmp/</dockerfilePath>
14 14
       <buildContext>/tmp/</buildContext>
15
+      <createFingerprint>true</createFingerprint>
16
+      <buildAdditionalArgs>--build-arg https_proxy=&quot;http://some.proxy:port&quot;</buildAdditionalArgs>
17
+      <forceTag>true</forceTag>
15 18
       <server plugin="docker-commons">
16 19
         <credentialsId>docker-server</credentialsId>
17 20
         <uri>unix:///var/run/docker.sock</uri>

+ 3
- 0
tests/builders/fixtures/docker-builder002.yaml View File

@@ -10,6 +10,9 @@ builders:
10 10
         skip-tag: false
11 11
         file-path: '/tmp/'
12 12
         build-context: '/tmp/'
13
+        create-fingerprint: true
14
+        build-args: --build-arg https_proxy="http://some.proxy:port"
15
+        force-tag: true
13 16
         registry:
14 17
             url: 'https://registry.example.org'
15 18
             credentials-id: 'registry-docker'

Loading…
Cancel
Save