ray/.buildkite/windows/install/bazel.ps1
Matti Picus 9ca34c7192
add dependencies to BUILD.bazel and update windows bazel to 4.2.1 (#19132)
* add dependencies to BUILD.bazel and update windows bazel to 4.2.1

* fixes from review
2021-10-11 10:25:19 -07:00

13 lines
865 B
PowerShell

$Env:BAZEL_URL="https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-windows-x86_64.zip"
Write-Host ('Downloading {0} ...' -f $env:BAZEL_URL);
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Invoke-WebRequest -Uri $env:BAZEL_URL -OutFile 'bazel.zip';
Write-Host 'Expanding ...';
New-Item -ItemType Directory -Path C:\bazel -Force | Out-Null;
Expand-Archive bazel.zip -DestinationPath C:\bazel -Force;
Write-Host 'Removing ...';
Remove-Item bazel.zip -Force;
[Environment]::SetEnvironmentVariable("BAZEL_PATH", "C:\bazel\bazel.exe", [System.EnvironmentVariableTarget]::Machine)
$systemPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::Machine)
$systemPath += ';C:\bazel'
[Environment]::SetEnvironmentVariable("PATH", $systemPath, [System.EnvironmentVariableTarget]::Machine)