use the released bazel for cleanup
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index d808006..4f1245a 100644
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -265,7 +265,7 @@
bazel_binary = download_bazel_binary(tmpdir, source_step)
if git_repository:
clone_git_repository(git_repository, platform)
- cleanup(bazel_binary)
+ cleanup(platform)
execute_shell_commands(config.get("shell_commands", None))
execute_bazel_run(bazel_binary, config.get("run_targets", None))
if not test_only:
@@ -279,7 +279,7 @@
config.get("test_targets", None), bep_file)
upload_failed_test_logs(bep_file, tmpdir)
finally:
- cleanup(bazel_binary)
+ cleanup(platform)
if tmpdir:
shutil.rmtree(tmpdir)
if exit_code > -1:
@@ -337,10 +337,10 @@
os.chdir(clone_path)
-def cleanup(bazel_binary):
+def cleanup(platform):
print("\n--- Cleanup")
if os.path.exists("WORKSPACE"):
- fail_if_nonzero(execute_command([bazel_binary, "clean", "--expunge"]))
+ fail_if_nonzero(execute_command(["bazel", "clean", "--expunge"]))
if cleanup_commands(platform):
shell_command = "\n".join(cleanup_commands(platform))
fail_if_nonzero(execute_command(shell_command, shell=True))