X Tutup
Skip to content

Commit 444ef2f

Browse files
committed
Generalize Windows CI setup script for any user.
The current Windows CI setup script assumes it will always be run under the `azureuser` username. While this username is defined in the Windows CI GitHub action, the current version of the script both exposes us to a future risk of breaking should the CI action be changed, and is also unfriendly to `curl | sh`-ing it for quick test environment setups. This patch makes the Windows CI setup script work with any username provided they have administrative privileges. Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
1 parent 3d6bfa3 commit 444ef2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/setup/prepare_env_windows.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ foreach ($package in $PACKAGES.Keys) {
2525

2626
Write-Host "Set up environment."
2727

28-
$path = ";c:\Program Files\Git\bin;c:\Program Files\Go\bin;c:\Users\azureuser\go\bin;c:\containerd\bin"
28+
$userGoBin = "${env:HOME}\go\bin"
29+
$path = ";c:\Program Files\Git\bin;c:\Program Files\Go\bin;${userGoBin};c:\containerd\bin"
2930
$env:PATH+=$path
3031

3132
Write-Host $env:PATH
@@ -42,4 +43,4 @@ go get -u github.com/jstemmer/go-junit-report
4243
$CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-windows-amd64.tar.gz"
4344
curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz
4445
tar -xvf c:\crictl.tar.gz
45-
mv crictl.exe c:\Users\azureuser\go\bin\crictl.exe # Move crictl somewhere in path
46+
mv crictl.exe "${userGoBin}\crictl.exe" # Move crictl somewhere in path

0 commit comments

Comments
 (0)
X Tutup