From patchwork Fri Jun 29 20:52:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 140653 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1310045ljj; Fri, 29 Jun 2018 14:07:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflVLS8aO/XwqYcHhuHZyh4FUVkR3giivB0f/NET5+AH9rUtUSVy9KB2xdZduKsVw+KEOrW X-Received: by 2002:a0c:84e6:: with SMTP id m93-v6mr14802450qva.227.1530306457366; Fri, 29 Jun 2018 14:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530306457; cv=none; d=google.com; s=arc-20160816; b=r/01Vtt33vLkuzTtJjJgmjt8LaV2pbsoDLFQ4c7ECMBNY9rE6DWeJnspqcsxGdIcr1 G4KSE79SBqQxsn7WpHT6TCasxMx1k8KdOldPixvFB1c2R4x5MF9YY4SVma1h+hy5dHDW wAopehvfKjdPBTyZn5d2C2rcUYeZxjCmSKNcgvU7dVh+SHAlERYZRitTNDFfXMmkEjQ2 ItbJhO0bSENIYdkQxYf/9e/FzhmRdeiUkIb4/B/g/lczk9iEGkSNolPWHzDNqBUN4RGz aeYqSYw5OcpWumLKw9cuswVNPGo3Gd5Efg7yPd1NP/pR+oI3g5duirtsjDFjuP5gULw8 lciA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=p9rRyxTJITniLi4ouOl1Cg07vbyUK2xhBh3DN9Z1jp4=; b=1DjR7N3B7RzAj2HZ7UB7ByMrtt3V642IWS5N3vxQ+xqL030Aqii9jyoDqxPwed65iT x8VsUmnPu8/7+ZFumsfD2nNh5Y8sBxz86jVgJxiDEYsCe1uLLLYXDCsuu5MFLDgFM0Gn lVZbuu0z9BViuQ6PuwsUq4x2caZpam37xsWIpnji+mcxoSOMi3nnSVXkkOr/ScLWkfb7 AqIgiP8ofYUhOsTI4pr9vdknMMUpiT0wLo15VdTMYpvXyAwMJEMnN/diKmeNZL68y7NU 1DMsTjBog8qIIPHDOYKfhHs66BYw1VKcEg0+guunRmKSleJtnMyppZGmsmiM5VKWf66g 7rBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=baapDIev; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 88-v6si840925qta.172.2018.06.29.14.07.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jun 2018 14:07:37 -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; dkim=fail header.i=@linaro.org header.s=google header.b=baapDIev; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0cC-0005qO-Oq for patch@linaro.org; Fri, 29 Jun 2018 17:07:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0Nw-0008Du-8M for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ0Nv-0006f1-Dw for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:52 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:32874) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ0Nv-0006ci-3B for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:51 -0400 Received: by mail-wm0-x229.google.com with SMTP id z6-v6so2894382wma.0 for ; Fri, 29 Jun 2018 13:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p9rRyxTJITniLi4ouOl1Cg07vbyUK2xhBh3DN9Z1jp4=; b=baapDIev7maUaXxjb0BXMJ8iOE+BA6mWiuegqEPYhvj2Wu/vCwZzg0DssFT50FYLLl jv0q1qVGq0UG7o7fw+kcAa8o2PzXsdyvbISiTQRKGytfUguBENhb9fNxl0M/dT5QqVOk Dy4D4L8EAlSEADVy6yV6J96OB7cJmH+MfrchY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p9rRyxTJITniLi4ouOl1Cg07vbyUK2xhBh3DN9Z1jp4=; b=ayu5puKa+C0Nu7+vePY9tWB0PwNLnTSOcopGSrQ2n4jJTrBxPjat+txK7tt06zLtwD AdTg8TTnjfrlj5ZGA9l/SI7btlbPKZWzEEiLNdmau9gU3a9EDKGBWwHG9SPRqGV8Le5O y2OhD9WbhCVDR7OwYBVp63uGkCmlCbAEMTHHHaqVbQWeFrA1e68sYri1ztIRj0lut9No p+DeHmcnCm228KMs7dlxBzQ6Ggqupur5hVVCY8CJIBCY3379LiQYfIbCur5xUkunlAXA GytBVxASaDe4eU4+WnrAwkTqPcrFYlHDr5T+PCriz3OvUlA0sRfyDUUAJTkM5367qsqe VPHw== X-Gm-Message-State: APt69E2x9wwdWAwGI4p2kViFv+p8bRdD8AK3M46Wzwk4yCbxQ38qZ4Wz gootDXNEuCTUlJDRjSBM+HHURQ== X-Received: by 2002:a1c:58d5:: with SMTP id m204-v6mr2633833wmb.118.1530305569876; Fri, 29 Jun 2018 13:52:49 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d1-v6sm6731791wrm.9.2018.06.29.13.52.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 13:52:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 11EA63E0B55; Fri, 29 Jun 2018 21:52:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Fri, 29 Jun 2018 21:52:27 +0100 Message-Id: <20180629205232.27190-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629205232.27190-1-alex.bennee@linaro.org> References: <20180629205232.27190-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::229 Subject: [Qemu-devel] [PATCH v2 16/21] docker: add env parser to docker.py build step 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: , Cc: pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We need to pass environment variables down to the debbootstrap.pre script to be able to specify build parameters. Signed-off-by: Alex Bennée --- tests/docker/docker.py | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index b279836154..388e86ada2 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -293,6 +293,8 @@ class BuildCommand(SubCommand): parser.add_argument("--add-current-user", "-u", dest="user", action="store_true", help="Add the current user to image's passwd") + parser.add_argument("--env", "-E", action='append', nargs=1, + help="Set FOO=BAR in envronment") parser.add_argument("tag", help="Image Tag") parser.add_argument("dockerfile", @@ -302,6 +304,12 @@ class BuildCommand(SubCommand): dockerfile = open(args.dockerfile, "rb").read() tag = args.tag + # Process env setting + if args.env: + for e in args.env: + (env, val) = e[0].split("=") + os.environ[env] = val + dkr = Docker() if "--no-cache" not in argv and \ dkr.image_matches_dockerfile(tag, dockerfile):