diff --git a/docs/playbooks.md b/docs/playbooks.md index e1f2822..e8d5610 100644 --- a/docs/playbooks.md +++ b/docs/playbooks.md @@ -142,11 +142,11 @@ To spawn a new Windows agent: 1. Add new windows machine wih OS "Windows Server" and version with "desktop experience" (so you can RDP) and boot disk size ~200 Gb. There is a "windows-agent-template" that might not be up to date. 1. Go to the [GCP page](https://pantheon.corp.google.com/compute/instances?project=llvm-premerge-checks&instancessize=50) again 1. Login to the new machine via RDP (you will need a RDP client, e.g. Chrome app). -1. Add a powershell shortcut at desktop with "run as admin" flag. Create a folder with machine name (e.g "w16c2-2") somewhere and click "add new toolbar" on windows toolbar: this way it will be easier to identify which machine you are working with later. +1. (optional, quality of life) Add a powershell shortcut at desktop with "run as admin" flag. Create a folder with machine name (e.g "w16c2-2") somewhere and click "add new toolbar" on windows toolbar: this way it will be easier to identify which machine you are working with later. 1. Run these commands in the power shell under admin to bootstrap the Windows machine: ```powershell - Invoke-WebRequest -uri 'https://raw.githubusercontent.com/google/llvm-premerge-checks/main/scripts/windows_agent_bootstrap.ps1' -OutFile c:\windows_agent_bootstrap.ps1 - c:/windows_agent_bootstrap.ps1 +Invoke-WebRequest -uri 'https://raw.githubusercontent.com/google/llvm-premerge-checks/main/scripts/windows_agent_bootstrap.ps1' -OutFile c:\windows_agent_bootstrap.ps1 +c:/windows_agent_bootstrap.ps1 ``` VM will be restarted after a prompt. diff --git a/scripts/windows_agent_bootstrap.ps1 b/scripts/windows_agent_bootstrap.ps1 index 473d5ab..f8377fd 100644 --- a/scripts/windows_agent_bootstrap.ps1 +++ b/scripts/windows_agent_bootstrap.ps1 @@ -63,8 +63,7 @@ if ($sdd) { } # Clone scripts repo. Restarting in a new session to pick up profile updates. -powershell -command 'git clone https://github.com/google/llvm-premerge-checks.git "c:\llvm-premerge-checks"' - +cmd.exe /c start powershell.exe -c {git clone https://github.com/google/llvm-premerge-checks.git c:/llvm-premerge-checks} # create folder for credentials New-Item -Path "C:\" -Name "credentials" -ItemType "directory" set-content c:\credentials\buildkite-env.ps1 '# Insert API tokens and replace NAME to something meaningful. @@ -74,7 +73,7 @@ $Env:BUILDKITE_AGENT_NAME= "NAME" $Env:BUILDKITE_AGENT_TAGS = "queue=windows,name=NAME" $Env:CONDUIT_TOKEN = ""' Write-Host "Open editor to set agent options..." -Start-Process -FilePath "notepad" -Wait -Args "c:\credentials\buildkite-env.ps1" +Start-Process -FilePath "notepad" -Wait -Args "c:\credentials\buildkite-env.ps1" # Add task to start agent after restart. schtasks.exe /create /tn "Start Buildkite agent" /ru SYSTEM /SC ONSTART /DELAY 0005:00 /tr "powershell -command 'C:\llvm-premerge-checks\scripts\windows_agent_start_buildkite.ps1 -workdir c:\ws'"