Print environment variables in every execution (#414)
* Print environment variables in every execution
This will help us debug the failing projects on CI
Change-Id: Ibce2c1dbe51867ece0e233b575445af234a96b65
* Some refactor
Change-Id: I2e6aa8ec3d8faea65047510dd7a2e0bd4ca52a27
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index 97960bf..e3154e6 100644
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -459,6 +459,8 @@
print_bazel_version_info(bazel_binary)
+ print_environment_variables_info()
+
if incompatible_flags:
print_expanded_group("Build and test with the following incompatible flags:")
for flag in incompatible_flags:
@@ -702,6 +704,12 @@
execute_command([bazel_binary, "--nomaster_bazelrc", "--bazelrc=/dev/null", "info"])
+def print_environment_variables_info():
+ print_collapsed_group(":information_source: Environment Variables")
+ for key, value in os.environ.items():
+ eprint("%s=(%s)" % (key, value))
+
+
def upload_bazel_binary(platform):
print_collapsed_group(":gcloud: Uploading Bazel Under Test")
binary_path = "bazel-bin/src/bazel"