From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHvA6-00087q-II for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHvA4-0002TW-KC for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:42:53 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:37488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHvA4-0002TF-EM for qemu-devel@nongnu.org; Tue, 28 Jun 2016 11:42:52 -0400 Received: by mail-wm0-x229.google.com with SMTP id a66so33937724wme.0 for ; Tue, 28 Jun 2016 08:42:52 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 28 Jun 2016 16:42:42 +0100 Message-Id: <1467128564-13476-4-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1467128564-13476-1-git-send-email-alex.bennee@linaro.org> References: <1467128564-13476-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v3 3/5] tests/docker/docker.py: check and run .pre script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, riku.voipio@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= The docker script will now search for an associated $dockerfile.pre script which gets run in the same build context as the dockerfile will be. This is to support pre-seeding the build context before running the docker build. Signed-off-by: Alex Bennée --- v3 - new for v3, split from previous patch - use check_call when running the pre-script --- tests/docker/docker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 96d906e..244901d 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -221,6 +221,12 @@ class BuildCommand(SubCommand): # Create a docker context directory for the build docker_dir = tempfile.mkdtemp(prefix="docker_build") + # Is there a .pre file to run in the build context? + docker_pre = os.path.splitext(args.dockerfile)[0]+".pre" + if os.path.exists(docker_pre): + subprocess.check_call(os.path.realpath(docker_pre), + cwd=docker_dir) + # Do we include a extra binary? if args.include_executable: _copy_binary_with_libs(args.include_executable, -- 2.7.4