]> granicus.if.org Git - esp-idf/commitdiff
tools, ci: Use non-interactive mode for idf_tools in CI
authorAnton Maklakov <anton@espressif.com>
Wed, 5 Jun 2019 07:16:19 +0000 (14:16 +0700)
committerAnton Maklakov <anton@espressif.com>
Wed, 5 Jun 2019 08:56:03 +0000 (15:56 +0700)
.gitlab-ci.yml
tools/idf_tools.py

index 1b2acd4819561ba732e5aa065f29c2b364c53e94..398c5b6c94e87502ab3e17f8f7685bad33f7c66a 100644 (file)
@@ -74,8 +74,7 @@ variables:
   rm -rf "$CUSTOM_TOOLCHAIN_PATH"
 
 .setup_tools: &setup_tools |
-  tools/idf_tools.py install &&
-  eval "$(tools/idf_tools.py export)"
+  tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
 
 before_script:
   - source tools/ci/setup_python.sh
index 362a5f46bd31c686abe3992af5f2b3077854e334..d53e036bf6ea4d122d6115d00913ab2d72344a18 100755 (executable)
@@ -128,6 +128,7 @@ EXPORT_KEY_VALUE = 'key-value'
 
 
 global_quiet = False
+global_non_interactive = False
 global_idf_path = None
 global_idf_tools_path = None
 global_tools_json = None
@@ -521,7 +522,7 @@ class IDFTool(object):
         for retry in range(DOWNLOAD_RETRY_COUNT):
             local_temp_path = local_path + '.tmp'
             info('Downloading {} to {}'.format(archive_name, local_temp_path))
-            urlretrieve(url, local_temp_path, report_progress)
+            urlretrieve(url, local_temp_path, report_progress if not global_non_interactive else None)
             sys.stdout.write("\rDone\n")
             sys.stdout.flush()
             if not self.check_download_file(download_obj, local_temp_path):
@@ -1150,6 +1151,7 @@ def main(argv):
     parser = argparse.ArgumentParser()
 
     parser.add_argument('--quiet', help='Don\'t output diagnostic messages to stdout/stderr', action='store_true')
+    parser.add_argument('--non-interactive', help='Don\'t output interactive messages and questions', action='store_true')
     parser.add_argument('--tools-json', help='Path to the tools.json file to use')
     parser.add_argument('--idf-path', help='ESP-IDF path to use')
 
@@ -1204,6 +1206,10 @@ def main(argv):
         global global_quiet
         global_quiet = True
 
+    if args.non_interactive:
+        global global_non_interactive
+        global_non_interactive = True
+
     global global_idf_path
     global_idf_path = os.environ.get('IDF_PATH')
     if args.idf_path: