A cross platform build agent for Microsoft Visual Studio Online (VSO) and Team Foundation Server (TFS). Supported on Mac OSX and Linux.
Related:VSTS Build Tasks, VSTS Task SDK, VSTS Node API
New Release
A new 0.3.x release includes the following features. If you have a 0.2.x agent, you should update (see Updating Existing Agents below). The new release includes:
- Release Management vNext Support
- TfsVC xplat support using TEE command line
- Extensions (collection level tasks via extensions)
- Pull Request Support
- SVN support
- Service Endpoint support
- Shorter repo paths
- Summary markdown support
Mac OSX: Download and install node from nodejs.org
Linux: Install using package manager
From a terminal ensure at least node 4.2 and npm 2:
$ node -v && npm -v
v4.2.0
2.5.1
Installs the agent installer once globally. This allows you to stamp out instances of the agent.
$ sudo npm install vsoagent-installer -g
$ sudo chown -R $USER ~/.npm
This does not install an agent. It simply pulls down the latest version of the agent installer.
Use 0.4@preview for now
$ sudo npm install vsoagent-installer@preview -g
$ sudo chown -R $USER ~/.npm
Basic Auth is required for OSX/Linux Access. Ensure ssl/https. Instructions Here
From a directory you created for the agent, run the installer. Repeat from different folders for multiple agents. Prefer running this from under your home directory (~)
~$ mkdir myagent; cd myagent
~/myagent$ vsoagent-installer
>> Video: Configure VSO Xplat Agent<<
Determine which account the agent will run as.
- Determine the account the agent will use to listen for builds (the queue)
- (VSTS Online) Create a presonal access token. Profile in upper right.
- (On-Premises) Determine the local/domain account used for the build
- Account Admin (gear upper right), Control Panel link: Agent Pools tab, expand pool
- Add user to Agent Pool Administrators (allows adding agent to pool)
- Add user to Agent Pool Service Accounts (allows agent to listen to the build queue)
Run the vsoagent from the agent folder. Configuration will ask for the username and password of the account the agent will run as. note: if the agent isn't configured, on first run, it will configure.
$ node agent/vsoagent
Enter alternate username > someuser
Enter alternate password >
Enter agent name (enter sets yourmac.local) >
Enter agent pool name (enter sets default) >
Enter poolName(enter sets default) >
Enter serverUrl > https://contoso.visualstudio.com
...
Enter force basic (enter is false) >
Config saved
Waiting ...
VSTS Online should not force basic (enter)
On-Premises TFS Server access should force basic (true)
To run the agent, simply run vsoagent in the agent directory with node
$ node agent/vsoagent
Stop using ctrl-c The agent cleans up if you do this (sends SIGINT)
The agent will stay running interactively as long as your log on session is active.
If you want to keep running after you log off, consider running as a service (below), nohup (linux) or a docker container.
To test out, we recommend running interactively. It's also useful for running UI/emulator tests that require gui interaction. (LaunchAgent other option below)
Running interactively is good for testing and evaluation. But, in production the agent should be run as a service to ensure the agent survives reboots.
Repeat the same steps to update the agent. This will update the installer to the latest version.
$ sudo npm install vsoagent-installer -g
Go to the directory you created for the agent and run the same command you used to create the agent.
IMPORTANT: that directory should have a package.json file in it and a sub folder named agent.
$ vsoagent-installer
NOTE: Updating the agent will overwrite the code in the agent subfolder and update the package.json
The previously released stable agent was 0.2.29
$ sudo npm install vsoagent-installer@0.2.29 -g
$ sudo chown -R $USER ~/.npm
This does not install an agent. It simply pulls down the latest version of the agent installer.