bazel_rbe.bat 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @rem Copyright 2019 gRPC authors.
  2. @rem
  3. @rem Licensed under the Apache License, Version 2.0 (the "License");
  4. @rem you may not use this file except in compliance with the License.
  5. @rem You may obtain a copy of the License at
  6. @rem
  7. @rem http://www.apache.org/licenses/LICENSE-2.0
  8. @rem
  9. @rem Unless required by applicable law or agreed to in writing, software
  10. @rem distributed under the License is distributed on an "AS IS" BASIS,
  11. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. @rem See the License for the specific language governing permissions and
  13. @rem limitations under the License.
  14. @rem Avoid slow finalization after the script has exited.
  15. @rem See the script's prologue for info on the correct invocation pattern.
  16. setlocal EnableDelayedExpansion
  17. IF "%cd%"=="T:\src" (
  18. call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
  19. echo respawn script has finished with exitcode !errorlevel!
  20. exit /b !errorlevel!
  21. )
  22. endlocal
  23. cd github/grpc
  24. call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
  25. @rem Install bazel
  26. @rem Side effect of the tools/bazel script is that it downloads the correct version of bazel binary.
  27. mkdir C:\bazel
  28. bash -c "tools/bazel --version && cp tools/bazel-*.exe /c/bazel/bazel.exe"
  29. set PATH=C:\bazel;%PATH%
  30. bazel --version
  31. @rem Generate a random UUID and store in "bazel_invocation_ids" artifact file
  32. powershell -Command "[guid]::NewGuid().ToString()" >%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
  33. set /p BAZEL_INVOCATION_ID=<%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
  34. bazel --bazelrc=tools/remote_build/windows.bazelrc --output_user_root=T:\_bazel_output test --invocation_id="%BAZEL_INVOCATION_ID%" %BAZEL_FLAGS% --workspace_status_command=tools/remote_build/workspace_status_kokoro.bat //test/...
  35. set BAZEL_EXITCODE=%errorlevel%
  36. if not "%UPLOAD_TEST_RESULTS%"=="" (
  37. @rem Sleep to let ResultStore finish writing results before querying
  38. sleep 60
  39. python3 tools/run_tests/python_utils/upload_rbe_results.py || exit /b 1
  40. )
  41. exit /b %BAZEL_EXITCODE%