Steps:
- Intro
- VSO
- Docker
- xUnit
- Build
- Back end
- Selenium
- Docker
- Release Management
- Testing
To set up this demo you are going to need:
Once you have setup all the items above we can start building our demo.
-
Create a Team Project in your Visual Studio Online account
-
Click New under Recent projects & teams from the Overview page
- Enter Name
- Enter Description
- Select Process template
- Select Git for Version control
I only selected Git because of its popularity and it gave me the opportunity show our Pull request support. TFVC is not going
away and is still a valid source control choice.
To save some time, we are going to simply spin up a VM in Azure that already has Visual Studio installed. I will be using
Visual Studio Community 2015 with Azure SDK 2.7 on Windows Server 2012 R2 machine.
-
Create VM in Azure with Visual Studio installed
- Open the Azure Preview Portal
-
Click Add button
- Click Compute
- Click Marketplace
- Search for “Visual Studio 2015”
- Select “Visual Studio Community 2015 with Azure SDK 2.7 on Windows Server 2012 R2”
- Click Create
- Enter Host name
- Enter User name
- Enter Password
- Click Create
The first thing we are going to do is install the build agent on this machine.
-
Remote desktop into your VM
- Locate VM in Azure Preview Portal
-
Click the Connect
-
Download Agent from VSO
- Open Internet Explorer
- Navigate to your VSO account
- Click the Administer Account gear in the upper right hand corner of the screen
- Select Control panel
- Click Agent pools tab
- Click the Download agent link
- Save the file to your Downloads folder
- Right-click agent.zip
- Select Properties
- Ensure the file is unblocked
-
Extract the file to Agent1 folder
- Right-click agent.zip
- Select Extract All
- Enter C:\Agent1
- Click Extract
I number my folders because you can have multiple agents installed on a single machine. I tend to install one agent per core.
-
Run ConfigureAgent.cmd in elevated command prompt
- Press the Windows key
- Type CMD
- Right-click Command Prompt
- Select Run as administrator
- Navigate to the folder where you extracted the file contents
- Run ConfigureAgent.cmd
- You can either use the default name or have the name match the folder name, which in my case is Agent1
- Now enter your Visual Studio Online URL
-
Enter the agent pool to which you would like to add this agent.
-
Every Visual Studio Online account is created with two Agent Pools: Default and Hosted. You are free, however, to create
additional agent pools from the page where you downloaded the agent.
-
Accept the default working folder
-
You have a choice to decide where you would like the agent to store the files it will
be working with during builds and releases.
-
Answer N
-
Because we are going to be running Selenium tests we will want to run the agent in interactive
mode.
-
Sign in to your Visual Studio Online account
After you log in, the agent will be configured and begin running. If you return to your Visual Studio Online account you will see your new agent listed.
Next we are going to configure our machine to automatically sign in and start the agent. This will ensure that if our machine is rebooted for service updates our agent will restart. This is also required to ensure our Selenium tests will run successfully after a reboot of the machine.
-
Enable automatic log in
-
Open the Run dialog
- Press Windows Key + R
- Type “control userpasswords2”
- Press enter
- Uncheck the box for “User must enter a user name and password to use this computer.”
- Click the Apply button
- Enter the password for the user
- Click OK
- Click OK on the Users Accounts dialog
Now, every time your machine is rebooted the configured user will automatically log in to the machine.
Now we need to make sure that once the user is logged in that our agent starts in interactive mode. To do this we are going to create a shortcut that will start our agent, then simply place that shortcut in the startup folder for Windows.
-
Create shortcut in Startup folder
- Right-click the desktop
- Select New / Shortcut
- In the Create Shortcut dialog enter “cmd”
- Click Next
- Change the name to “Start Agent”
- Click Finish
- Right-click on the new shortcut
- Select Properties
- Append “/c {pathToVsoagent.exe}” to the target
- If you installed your agent to C:\Agent1, your target should look like this: C:\Windows\System32\cmd.exe /c c:\agent1\agent\vsoagent.exe
-
Click OK
If you double click the shortcut, your agent will start in interactive mode. Now we need to copy this shortcut into the startup folder for Windows. This will ensure that each time we log in the agent will be started.
-
Copy Short cut to startup folder
-
Open the Run dialog
- Press Windows Key + R
- Type “shell:startup“
- Press enter
- This will open the startup folder in Windows Explorer
- Drag and drop the shortcut to this folder
Now, whenever your machine is restarted your agents will start up in interactive mode.
With the agent installed and the machine configured, we can move onto the next step.