Skip to content

Instantly share code, notes, and snippets.

@cwoolum
Last active October 20, 2017 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwoolum/be33b2fb6115e6f50b3d4a5f7014ccca to your computer and use it in GitHub Desktop.
Save cwoolum/be33b2fb6115e6f50b3d4a5f7014ccca to your computer and use it in GitHub Desktop.
Using this you can create a brand new build agent for VSTS
Write-Output "Running config with subdomain $Env:VSTS_SUBDOMAIN and token $Env:VSTS_PATTOKEN"
./config.cmd --unattended --url "https://$Env:VSTS_SUBDOMAIN.visualstudio.com" --auth PAT --token $Env:VSTS_PATTOKEN --pool default
./run.cmd
FROM stefanscherer/node-windows:6.11
ENV VSTS_AGENT_VERSION 2.123.0
RUN powershell -Command \
Invoke-WebRequest $('https://github.com/Microsoft/vsts-agent/releases/download/v2.123.0/vsts-agent-win7-x64-2.123.0.zip') -OutFile 'vsts-agent.zip' -UseBasicParsing;\
Expand-Archive -path 'vsts-agent.zip' -destinationpath '.\agent'
ADD BootstrapAgent.ps1 /agent
WORKDIR /agent
ENTRYPOINT ["powershell" ,"./BootstrapAgent.ps1 -SubDomain $VSTS_SUBDOMAIN -Token $VSTS_PATTOKEN"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment