[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 3/5] tests/docker/docker.py: check and run .pre s
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v3 3/5] tests/docker/docker.py: check and run .pre script |
Date: |
Tue, 28 Jun 2016 16:42:42 +0100 |
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 <address@hidden>
---
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