From patchwork Tue Jul 19 08:16:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 72268 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp548063qga; Tue, 19 Jul 2016 01:19:43 -0700 (PDT) X-Received: by 10.55.49.135 with SMTP id x129mr25888636qkx.197.1468916383272; Tue, 19 Jul 2016 01:19:43 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p31si19005409qtb.49.2016.07.19.01.19.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Jul 2016 01:19:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:53648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQFi-0004qt-Rp for patch@linaro.org; Tue, 19 Jul 2016 04:19:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQD6-0002oX-3b for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:17:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPQD4-0007nD-7W for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:16:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQD4-0007n8-2D for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:16:58 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9C5E804E8 for ; Tue, 19 Jul 2016 08:16:57 +0000 (UTC) Received: from ad.usersys.redhat.com (dhcp-14-122.nay.redhat.com [10.66.14.122]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6J8Gqt3015076 for ; Tue, 19 Jul 2016 04:16:57 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 16:16:43 +0800 Message-Id: <1468916208-18668-4-git-send-email-famz@redhat.com> In-Reply-To: <1468916208-18668-1-git-send-email-famz@redhat.com> References: <1468916208-18668-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Jul 2016 08:16:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v6 3/8] tests/docker/docker.py: check and run .pre script X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée 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 Message-id: 1468335639-24582-4-git-send-email-alex.bennee@linaro.org --- tests/docker/docker.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.7.4 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 96d906e..b61d934 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 = 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): + rc = subprocess.call(os.path.realpath(docker_pre), + cwd=docker_dir) + if rc == 3: + print "Skip" + return 0 + else: + 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,