From e5de8e455841eaa87740eaaccbfd1ecbec44d212 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Thu, 11 Aug 2016 18:48:31 +0200 Subject: [PATCH] docker-build-publish: Add support for buildContext Change-Id: I0b42f49bc1ec0b816ecd3622d20105231aa6c6db --- jenkins_jobs/modules/builders.py | 5 ++++- tests/builders/fixtures/docker-builder001.xml | 1 + tests/builders/fixtures/docker-builder001.yaml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py index d7a1fffb9..57f6d288c 100644 --- a/jenkins_jobs/modules/builders.py +++ b/jenkins_jobs/modules/builders.py @@ -3555,7 +3555,9 @@ def docker_build_publish(parse, xml_parent, data): :arg bool skip-decorate: Do not decorate the build name. (default false) :arg bool skip-tag-latest: Do not tag this build as latest. (default false) :arg bool skip-push: Do not push. (default false) - :arg str file-path: Project root of Dockerfile. (default '') + :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 '') Example: @@ -3575,6 +3577,7 @@ def docker_build_publish(parse, xml_parent, data): ('skip-tag-latest', 'skipTagLatest', False), ('skip-push', 'skipPush', False), ('file-path', 'dockerfilePath', ''), + ('build-context', 'buildContext', ''), ] convert_mapping_to_xml(db, data, mapping, fail_required=True) diff --git a/tests/builders/fixtures/docker-builder001.xml b/tests/builders/fixtures/docker-builder001.xml index bf08040ca..5543bd267 100644 --- a/tests/builders/fixtures/docker-builder001.xml +++ b/tests/builders/fixtures/docker-builder001.xml @@ -11,6 +11,7 @@ false false /tmp/ + /tmp/ diff --git a/tests/builders/fixtures/docker-builder001.yaml b/tests/builders/fixtures/docker-builder001.yaml index 14bbd580e..0b6ea9e8e 100644 --- a/tests/builders/fixtures/docker-builder001.yaml +++ b/tests/builders/fixtures/docker-builder001.yaml @@ -9,4 +9,5 @@ builders: skip-latest: false skip-tag: false file-path: '/tmp/' + build-context: '/tmp/'