|
13 | 13 | :: limitations under the License. |
14 | 14 | :: |
15 | 15 | setlocal enabledelayedexpansion |
16 | | -:: release_windows.bat |
17 | | -:: Kokoro entrypoint for Windows Release builds. |
| 16 | +set "RELEASE_STATUS=0" |
| 17 | +set "FETCH_RETRIES=10" |
| 18 | +set "FETCH_RETRY_DELAY_S=10" |
18 | 19 |
|
19 | 20 | echo === Loading Environment Configuration === |
20 | 21 | call "%~dp0set_env_windows.bat" |
21 | 22 | if !ERRORLEVEL! NEQ 0 ( |
22 | 23 | echo Failed to configure build environment! |
23 | 24 | exit /b 1 |
24 | 25 | ) |
25 | | - |
26 | | -set "RELEASE_STATUS=0" |
27 | | - |
28 | 26 | :: If running locally (not on Kokoro), authenticate with gcloud. |
29 | 27 | if "%KOKORO_BUILD_ID%" == "" ( |
30 | 28 | gcloud auth application-default print-access-token --quiet >nul 2>&1 |
@@ -126,18 +124,18 @@ echo --- Pre-fetching Dependencies --- |
126 | 124 | set ATTEMPTS=0 |
127 | 125 | :fetch_loop |
128 | 126 | set /a ATTEMPTS+=1 |
129 | | -echo Fetch attempt !ATTEMPTS! of %FETCH_RETRIES%... |
| 127 | +echo Fetch attempt !ATTEMPTS! of !FETCH_RETRIES!... |
130 | 128 | bazel %STARTUP_FLAGS% fetch //... > fetch.log 2>&1 |
131 | 129 | set FETCH_STATUS=!ERRORLEVEL! |
132 | 130 | type fetch.log |
133 | 131 | if !FETCH_STATUS! NEQ 0 ( |
134 | 132 | findstr /i "timeout timed" fetch.log >nul |
135 | 133 | if !ERRORLEVEL! EQU 0 ( |
136 | | - if !ATTEMPTS! LSS %FETCH_RETRIES% ( |
137 | | - echo Fetch failed with timeout. Retrying in %FETCH_RETRY_DELAY_S% seconds... |
| 134 | + if !ATTEMPTS! LSS !FETCH_RETRIES! ( |
| 135 | + echo Fetch failed with timeout. Retrying in !FETCH_RETRY_DELAY_S! seconds... |
138 | 136 | :: Use ping instead of timeout because timeout command fails in non-interactive Kokoro environments |
139 | 137 | :: with "ERROR: Input redirection is not supported, exiting the process immediately." |
140 | | - set /a PINGS=%FETCH_RETRY_DELAY_S%+1 |
| 138 | + set /a PINGS=!FETCH_RETRY_DELAY_S!+1 |
141 | 139 | ping -n !PINGS! 127.0.0.1 >nul |
142 | 140 | goto fetch_loop |
143 | 141 | ) |
|
0 commit comments