diff --git a/containers/agent-windows-buildkite/Dockerfile b/containers/agent-windows-buildkite/Dockerfile index bdec6b2..55ec56f 100644 --- a/containers/agent-windows-buildkite/Dockerfile +++ b/containers/agent-windows-buildkite/Dockerfile @@ -9,9 +9,5 @@ FROM gcr.io/llvm-premerge-checks/agent-windows ARG token ENV BUILDKITE_BUILD_PATH=C:\ws\bk -#TODO(kuhnel): use the host machine name in the agent name. -# This needs to be set during run time in the start_agent.ps1 script. -ENV BUILDKITE_AGENT_NAME=win-vs17 - COPY start_agent.ps1 C:\scripts\ CMD "powershell C:\scripts\start_agent.ps1" \ No newline at end of file diff --git a/containers/agent-windows-buildkite/start_agent.ps1 b/containers/agent-windows-buildkite/start_agent.ps1 index 0b02057..d4d6378 100644 --- a/containers/agent-windows-buildkite/start_agent.ps1 +++ b/containers/agent-windows-buildkite/start_agent.ps1 @@ -3,4 +3,7 @@ $Env:buildkiteAgentToken = [IO.File]::ReadAllText("C:\credentials\buildkite-toke #Set-ExecutionPolicy Bypass -Scope Process -Force iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/buildkite/agent/master/install.ps1')) +# use the name of the host machine as name for the agent in buildkite +$env:BUILDKITE_AGENT_NAME="win-vs17 $env:PARENT_HOSTNAME" + C:\buildkite-agent\bin\buildkite-agent.exe start --tags "os=windows" \ No newline at end of file