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

This commit is contained in:
Zuul 2018-09-13 14:34:20 +00:00 committed by Gerrit Code Review
commit 22307f715f
5 changed files with 21 additions and 0 deletions

View File

@ -3950,6 +3950,12 @@ def docker_build_publish(parse, xml_parent, data):
:arg str file-path: Path of the Dockerfile. (default '')
:arg str build-context: Project root path for the build, defaults to the
workspace if not specified. (default '')
:arg bool create-fingerprint: If enabled, the plugin will create
fingerprints after the build of each image. (default false)
:arg str build-args: Additional build arguments passed to
docker build (default '')
:arg bool force-tag: Force tag replacement when tag already
exists (default false)
Minimal example:
@ -3974,6 +3980,9 @@ def docker_build_publish(parse, xml_parent, data):
('skip-push', 'skipPush', False),
('file-path', 'dockerfilePath', ''),
('build-context', 'buildContext', ''),
('create-fingerprint', 'createFingerprint', False),
('build-args', 'buildAdditionalArgs', ''),
('force-tag', 'forceTag', False),
]
helpers.convert_mapping_to_xml(db, data, mapping, fail_required=True)

View File

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

View File

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

View File

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

View File

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