From cfba9598d7cf97db1837123d6b96cc784c206473 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Wed, 10 May 2017 13:49:09 -0700 Subject: [PATCH] [helper] Add a prompt to build_image command for pulling base images. (#595) --- infra/helper.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/infra/helper.py b/infra/helper.py index b38bc1414..3c0a70bab 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -260,8 +260,18 @@ def docker_pull(image, pull=False): def build_image(args): """Build docker image.""" + pull = args.pull + if not pull: + y_or_n = raw_input('Pull latest base images (compiler/runtime)? (y/N): ') + pull = y_or_n.lower() == 'y' + + if pull: + print('Pulling latest base images...') + else: + print('Using cached base images...') + # If build_image is called explicitly, don't use cache. - if _build_image(args.project_name, no_cache=True, pull=args.pull): + if _build_image(args.project_name, no_cache=True, pull=pull): return 0 return 1