From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUxK-0001uA-1N for qemu-devel@nongnu.org; Tue, 19 Jul 2016 09:21:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPUxF-0001eo-79 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 09:21:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUxF-0001ee-1N for qemu-devel@nongnu.org; Tue, 19 Jul 2016 09:20:57 -0400 From: Fam Zheng Date: Tue, 19 Jul 2016 21:20:38 +0800 Message-Id: <1468934445-32183-4-git-send-email-famz@redhat.com> In-Reply-To: <1468934445-32183-1-git-send-email-famz@redhat.com> References: <1468934445-32183-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v7 03/10] 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: alex.bennee@linaro.org, famz@redhat.com From: Alex Benn=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=C3=A9e --- tests/docker/docker.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 96d906e..76750c4 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -221,6 +221,18 @@ class BuildCommand(SubCommand): # Create a docker context directory for the build docker_dir =3D tempfile.mkdtemp(prefix=3D"docker_build") =20 + # Is there a .pre file to run in the build context? + docker_pre =3D os.path.splitext(args.dockerfile)[0]+".pre" + if os.path.exists(docker_pre): + rc =3D subprocess.call(os.path.realpath(docker_pre), + cwd=3Ddocker_dir) + if rc =3D=3D 3: + print "Skip" + return 0 + elif rc !=3D 0: + print "%s exited with code %d" % (docker_pre, rc) + return 1 + # Do we include a extra binary? if args.include_executable: _copy_binary_with_libs(args.include_executable, --=20 2.7.4