provision: Pass proxy settings through sudo via environment.

This makes provision not fail when installing node behind a proxy.

See #10505 for details.
This commit is contained in:
zegervdv
2018-09-12 21:04:29 +02:00
committed by Tim Abbott
parent 30c493ed24
commit 6dd2218c50

View File

@@ -244,7 +244,13 @@ def main(options):
print("No changes to apt dependencies, so skipping apt operations.") print("No changes to apt dependencies, so skipping apt operations.")
# Here we install node. # Here we install node.
run(["sudo", "-H", "scripts/lib/install-node"]) proxy_env = [
"env",
"http_proxy=" + os.environ.get("http_proxy", ""),
"https_proxy=" + os.environ.get("https_proxy", ""),
"no_proxy=" + os.environ.get("no_proxy", ""),
]
run(["sudo", "-H"] + proxy_env + ["scripts/lib/install-node"])
# This is a wrapper around `yarn`, which we run last since # This is a wrapper around `yarn`, which we run last since
# it can often fail due to network issues beyond our control. # it can often fail due to network issues beyond our control.