20 Jul 2016

0 Comments

Deleting a TFS workspace from the command line

Today I had need to explicitly remove a TFS 2015 workspace. I was troubleshooting a build and wanted to completely remove any workspace the build service might be using.

I did this from a new TFS 2015 Build Agent machine (non-XAML) that had VS2015 installed as well. The process I used to do this was as follows.

1. Open a developer command prompt

2. Get a list of all workspaces (you can refine further if needed)

tf workspaces /server:http://{TFSServername}:8080/tfs/{CollectionName} /owner:*

This will return a list of all workspaces including the Owner of the workspace. Find the name of the workspace you want to delete and also pay attention to the owner name.

3. Use the following command to delete the specific workspace. (NOTE: The command above uses “workspaces” while this command uses “workspace” not the plural form)

tf workspace /server:http://{TFSServername}:8080/tfs/{CollectionName} /delete “{workspacename};{owner}”

In my case, I was looking for a workspace used by the new TFS 2015 Build Agent. This meant I could specify the workspace owner as “Project Collection Build Service” which was the scope I was using. This reduced the list of workspaces significantly which made it easy to find the workspaces I wanted to delete.

This was the exact command line I used as an example.

tf workspace /server:http://TFS:8080/tfs/DefaultCollection
/delete “ws_1_2;Project Collection Build Service”

If I had been scoping the build to just the Team Project, I would have used the “Project Build Service” instead.

25 Jun 2016

2 Comments

A Raspberry Pi3 VSTS Build Light-Part 3, installing the Codify VSTS Build Light software

In this third blog post in this series, I’ll walk you through getting the Codify VSTS Build light software installed and configured.

I’m running Visual Studio 2015 Enterprise edition with Update 2 on my laptop but you can download and install  Visual Studio Code if you prefer. (It’s FREE)

You’ll need the Universal Windows Platform Tools and Windows 10 SDK installed. If you don’t have this installed on your machine, you will be prompted to install it when you open the Codify Build Light solution.

VSTS Build Light - Addins for VS2015

Getting the software

I’m going to head over to https://github.com/Codify/build-light to download the software for the VSTS Build Light.  We’re going to choose fork the repository so that we have our own personal copy that we can use to maintain our own version of the code and/or submit pull requests with fixes and/or enhancements. I’m sure the Codify guys would absolutely love any updates and enhancements you’d like to contribute.

Folk Repository

Now we want to access the solution locally using Visual Studio. I already have the GitHub Extension for Visual Studio already installed in Visual Studio. Installing this extension provides the capability to connect to your GitHub account from the Connect Hub in Visual Studio.

1. Start Visual Studio
2. In the Team Explorer window, click the Manage Connections button in the toolbar.
3. In the GitHub section, click Clone
4. Sign into your GitHub account if prompted.
5. Select the fork from the list, optionally specify a path, then click Clone

You now have a copy of the repository locally.

6. At the top of the Connect hub you can click the hyperlink to Open an existing project or solution.
7. Locate the Codify.VisualStudioOnline.BuildLight.sln file and click Open.

At the time of writing, the solution contained two projects. This may change over time.
* The Codify.VisualStudioOnline.BuildLight project is “version 1” and can monitor a single build in VSTS.
* The Codify.Vsts.BuildLight project is a new WORK IN PROGRESS version of the project that can monitor multiple builds in VSTS.

For this project, I’m going to go ahead and install the Codify.VisualStudioOnline.BuildLight application onto the Raspberry Pi. Leave Visual Studio and the solution open for now and move onto the next section.

Getting the Raspberry Pi ready

1. Get your Raspberry Pi (with the Codify board) turned on and on the same network as the computer you’re running Visual Studio on.
2. On my laptop, I’m going to start the Windows 10 IoT Core Dashboard. This will allow us to find the Raspberry Pi device.
3. In the IoT Dashboard you should see your Raspberry Pi device. Take note of the IP address for your device.

VSTS Build Light - Shown in IoT Dashboard

Deploying the code from Visual Studio

1. Return to Visual Studio where you should still have the Codify solution open
2. In Solution Explorer, right-click the Codify.VisualStudioOnline.BuildLight project and click Properties from the context menu.
3. Click the Debug tab and look in the Start Options section.
4. Set the Target Device to Remote Machine
5. Enter the IP Address of your Raspberry Pi
6. Set the Authentication Mode to Universal.
7. Save the changes you have made.
8. In the standard toolbar, make sure Codify.VisualStudioOnline.BuildLight (Universal Windows)  is selected.

Deploy BuildLight software from VS

9. Click the Remote Machine button to build and deploy the application code to your device. You should notice that the deployment automatically downloads any missing frameworks that area required.

AppDeployed

Once the application has been deployed to the Raspberry Pi, you can set it as the default application so that it starts every time you tur on your device.

Configuring security for the connection to VSTS

The first thing we need to do is setup Alternate authentication credentials in our VSTS account. Hopefully the application will be updated to use Personal Access Tokens (PATs) soon as the Alternate authentication credentials is being phased out.

1. Open your browser and navigate to your VSTS account. Eg. yourname.visualstudio.com
2. Log into your account if requested.
3. Click your username in the top right-corner of the window and choose My Security.

Click My Security in VSTS

4. Click Alternate authentication credentials in the panel on the left.
5. You will need to check the checkbox to enable alternate access credentials and then provide a username and password. This access will have your user rights so make sure you use a strong password.

ConfigureAltCredentials

6. Click Save

Now you’re ready to go back to your Raspberry Pi.  This next step requires you to plug in a USB mouse, Keyboard and monitor using the HDMI port.  If you’re using a Raspberry Pi 3 you could also use the remote desktop experience to do this remotely which is much more convenient.

Configuring application settings and starting to monitor

Now that we have the application on the Raspberry Pi and permissions configured we’re ready to configure the application to connect to Visual Studio Team Services and select the build we want to monitor.

When you boot up the RPi with an HDMI monitor, you’ll see the configuration settings screen. If you don’t see this you can click the 3-cogs icon in the top left corner to display the dialog you see below.

1. Enter your VSTS account alias. This is the URL you use without the .visualstudio.com on the end.
2. Enter the username and password you chose when you enabled alternate access credentials.
3. Enter the Team Project name and the name of the Build definition you want to monitor.
4. You should leave the pin values the same as you see them below in the screenshot. (Red:18, Green:22, Blue:24)
5. Click Save and then click the Start button on the right. (Not shown in screenshot)

VSTS Build Light - CodifyAppSettings

CONGRATULATIONS!  You should now have a working VSTS Build monitor.

15 Jun 2016

0 Comments

DevOps using Visual Studio 2015 training in full swing

Some of the most exciting new features to arrive in Visual Studio Team Services and TFS 2015 have been the completely new Build system and the new Release Management capabilities built using the same technology. These are critical pieces to the DevOps puzzle for teams using VSTS or TFS as their ALM suite of choice.

To help educate teams on how to adopt DevOps best practices using Visual Studio, I have written a course focused specifically on this outcome.  The new 3-day DevOps using Visual Studio TFS 2015 course has already been delivered several times and has received very positive feedback.

We usually use electronic manuals where possible but for a client in Virginia this week, they requested printed hardcopy manuals. It was the first time I had the chance to “see” all my hard work in hard copy.

WP_20160614_07_34_10_Rich (2)

This is what 603 pages of DevOps knowledge and hands on exercises looks like

 

If this course is something you or your team may benefit from, there are scheduled courses coming up in the United States and Australia over the coming months. You can also just AskShane about onsite training or customised versions of the course.

There are two courses you may want to consider.

1. DevOps using Visual Studio TFS 2015 (3-day course)

2. Build and Release Management using TFS 2015 (2-day course which is a subset of the 3-day DevOps)

UNITED STATES (Online or in-person in Kirkland, WA)

* August 15-16: Build and Release Management using TFS 2015  [Register link]

* September 12-14:  DevOps using Visual Studio TFS 2015  [Register link]

* October 17-18: Build and Release Management using TFS 2015  [Register link]

* November 28-30: DevOps using Visual Studio TFS 2015  [Register link]

* December 12-13: Build and Release Management using TFS 2015  [Register link]

AUSTRALIA

* August 1-2: Sydney: Build and Release Management using TFS 2015 [Register link]

* August 3-5: Sydney: DevOps using Visual Studio TFS 2015  [Register link]

* August 8-9: Melbourne: Build and Release Management using TFS 2015 [Register link]

* August 10-12: Melbourne: DevOps using Visual Studio TFS 2015 [Register link]

 

13 May 2016

1 Comment

A Raspberry Pi3 VSTS Build Light-Part 2, installing Windows 10 IoT Core

In this second part of this blog series, I’ll walk through setting up Windows 10 IoT Core on your Raspberry Pi 3.  Technically it’s more like setting up Windows 10 IoT Core on a MicroSD but that’s beside the point Smile

If you missed part 1 you can find it here.

At the moment, the version of Windows IoT core for Raspberry Pi3 that includes the drivers for the on-board WiFi is only available to Windows Insiders. If you’re not already an insider, you can go and sign up. (It’s free.)   I am writing this in early May 2016, so this may not be the case at the time you’re reading this.

For this exercise, I am using a Sandisk Ultra Class 10 8Gb MicroSD card to install Windows IoT Core and the Codify Build light software on. If you’re considering purchasing one, I’d go for a 16Gb MicroSD as the price is almost the same as the 8Gb ones.

The first thing I’m going to download is the March 2016 Insider Preview for Windows 10 IoT Core. The latest one I can download at the moment is build 14322. If there’s a more recent one available, I’d go ahead and get that one. Save the ISO file somewhere convenient for now then double-click it to mount the ISO.

Open Windows Explorer and navigate to the mounted ISO image. You should find a single MSI installer in the root of the mounted image. In my case the file is named “Windows_10_IoT_Core_for_RPi2.msi” which is misleading as I definitely selected the Raspberry Pi 3 image.

Double-click the MSI file and follow the prompt to install the program. This will give us easy access to the FFU file we’ll need in the next section.

The next thing I’m going to do is download and install the Windows 10 IoT Core Dashboard from the Microsoft website. This makes getting started much easier.

After the dashboard has been installed, it automatically runs and gives you the option to setup a new device. Go ahead and click “Set up a new device”.

VSTS Build Light - IoT Dashboard

On the setup new device screen, the Raspberry Pi 3 is not currently listed. I expect this to change soon. For now, I will select “Custom” for the device type and then point to the FFU file that was created when you ran the installer in the previous step. You should be able to find it at  C:\Program Files (x86)\Microsoft IoT\FFU\RaspberryPi2\flash.ffu.

You need to have access to the MicroSD card now. When prompted to select the drive, select the drive letter corresponding to your Micros SD card.

You will need to accept the licensing terms and click Install. A command window will be displayed and you’ll see the Deployment Image Servicing and Management Tool displayed as well as a progress indicator as it sets up Windows 10 IoT core on your MicroSD card.

VSTS Build Light -DISM

Once the image has been extracted into your MicroSD card, you should see a message to let you know the MicroSD card is ready. Remove the card from your PC and insert it into the MicroSD card slot in the Raspberry Pi 3. In my case, I’m going to choose to connect the Raspberry Pi 3 via an Ethernet cable before I look at the Wireless drivers and configuration.

Connect the power supply to your Raspberry Pi 3 and turn on the power.

In the IoT Dashboard, click “My Devices”. If everything is working you should see you device appear as shown in the following screenshot.

VSTS Build Light - IoT Dashboard New Device

In the list of My Devices, I’m going to click the pencil icon in the settings column to change the settings for my Raspberry Pi 3. Specially, I am going to set the name of my device to “RPiVSTSBuild” but you can choose a suitable name for yourself. You should also set a device password for the Administrator account on this screen. The default password is p@ssw0rd. Once you rename, you will be prompted to reboot your device. Click OK.

Once your Raspberry Pi has rebooted, click the VSTS Build Light - Global iconicon to display the device portal in your browser. You will be prompted to enter the username (administrator) and the password you have selected.

VSTS Build Light - Device Home page

I have configured the Time zone to match my current time zone and I’ve configured my Wireless settings to connect to my local wireless network.

That’s about it for getting Windows 10 IoT Core ready. In the third and final part of this blog series, we’ll get our computer configured to use Visual Studio 2015 to build the Codify build light software . We’ll then deploy it to the Raspberry Pi and configure it to connect to our VSTS account.

Coming soon:  A Raspberry Pi3 VSTS Build Light-Part 3, installing the Codify VSTS Build Light software

12 May 2016

2 Comments

A Raspberry Pi3 VSTS Build Light–Part 1, the hardware

In this three part series, I’ll walk you through my experience creating a VSTS Build Light using a Raspberry Pi3 and an add-on board from the great folk at Codify, here in Brisbane, Australia.

We’ll walk through setting up the hardware in this blog post. In the second blog post we’ll install Windows IoT Core on the MicroSD card ready to run on the Raspberry Pi 3. Finally in the third blog post we’ll setup our PC for building and deploying the Codify software onto the Raspberry Pi. We’ll configure the software to connect to our VSTS account and let it know which build we want it to show the status of.

Here’s a photo of the finished project showing that the status of my build is happy and healthy (for now) Smile

14 ASuccessfulBuild

Here a list of the parts and tools I’ll be using in this three part blog series. I live in Brisbane, Australia and the closest electronics shop to me is called Jaycar. You can find them all around Australia.

Parts list:

  • Raspberry Pi 3 (Purchased from Newark Element 14 in the US but broadly available)
  • Sandisk Ultra 8Gb MicroSD card (Class 10)
  • Official Raspberry Pi 3 Case
  • Spacer Nylon Tapped Hex M3x9MM Pk25 (Jaycar# HP0922)
  • Washer Nylon M3 Flat Wht Pk10 (Jaycar# HP0148)
  • Screw M3x6mm Phil R/Hd ZP Pk25 (Jaycar# HP0400)
  • 12V DC 1.5 Amp regulated switch mode power supply
  • RGB Light Strip
  • Codify VSTS Build Light Circuit Board

Tool list:

  • Wire cutters
  • Screwdriver (small Phillips head)
  • Sharp scissors for cutting RGB light strip to desired length
  • Soldering iron (for tinning the ends of the braided cable on the RGB power strip only)

 

Here’s a look at some of our parts as we prepare to get started. Note that the official Raspberry Pi 3 power supply is shown in the photo. I didn’t end up using this as the Raspberry Pi gets its power from the Codify board.

01 Parts laid out

I’m choosing to use a Raspberry Pi 3 for this project primarily due to the fact it has built-in wireless networking which means I don’t need to have a USB wireless adapter hanging out of the device to connect to VSTS. You can easily use a Raspberry Pi 2 if you happen to have one and you can always choose to connect via network cable in the ethernet port if you prefer.

02 RaspberryPi3

Here’s the hero of our project. It is a board that the guys at Codify have created as a project for themselves. Ben Parker kindly gave me a couple of these to use and demonstrate. You can read about the origins of their VSTS Build light on their blog. The custom printed board is certainly much nicer than wires on a breadboard.

03 CodifyBoard

This board is designed to plug directly into the 40 PIN GPIO connect on the Raspberry Pi. Note that it does not use all 40 pins but it is fairly obvious where you line up pin 1.

Ben was kind enough to point out one issue that you’ll need to be aware of. As you can see in the next photo the two pins from the terminal block that you connect to 12 volt power to are at risk of shorting against the metal shield around the HDMI connector. This would be bad Smile

04 SpacersRequired

To solve this problem I purchased a set of both 9mm (Jaycar HP0922) and 12mm (Jaycar HP0924) nylon tapped hex spacers. I found the 12mm spacers were slightly too tall and the 9mm ones just slightly too short. A Nylon M3 Flat washer proved to be just the right answer to this problem.

I screwed the spacer and washer to the Codify board using a M3x6mm Phillips head screw (Jaycar# HP0400) as you can see in the following photo.

05 SpacersOnCodifyBoard

I’m much happier with the space between the pins from the terminal block and the HDMI connector now. You should also note that I am not securing the other ends of the spacers to the Raspberry Pi board. I find the IDC connector holds the Codify very firmly to the Raspberry Pi and by leaving the other end of the spacers open, they’ll line up nicely with the bottom of the official Raspberry Pi case.

06 BetterClearence

The next item on the agenda is to look at the LED light strip. The 12 volt RGB light strips seem to be popping up everywhere. Make sure you get an RGB one as there are plenty of single colour ones out there which aren’t nearly as useful in showing build status.

Most light strips can be easily cut to whatever length you want depending on how and where you’re going to mount your build light. The strips usually have a 3M adhesive strip on the back so they can be stuck to a wall or piece of furniture.

07 CutLEDStripToLength

If you look around you can also find a variety of different aids to help you mount the light strip including clip-on corners and little plastic brackets you can use to tack into place on walls/furniture.

08 LEDStripCorners

Usually both ends of the light strip are terminated with a 4-pin plug. These allow you to easily chain them if you want to create a particularly long light strip. For my build light, I’ve cut the strip to around 80 cms in length. I’ll also cut off the plug as you can see below and then strip the wires back and tin the wire with a little solder. This will make it easy to attach the light strip to the terminal block on the Codify board.

09 WiresFromLEDStrip

Now I’ll go back to the Raspberry Pi and place it into the bottom half of the official Raspberry Pi 3 case. You can see in the photo below why we’re not securing the nylon spacer to the Raspberry Pi. The hole in the PCB lines up with the lug in the bottom of the case and holds it in place.

10 AligningPCBtoCase

You can see now what the assembled project looks like. The Codify board is a great size to just fit on to of the Raspberry Pi. I should point out now that the top of the Raspberry Pi case is not going to fit due to the Codify board. We’ll only be taking advantage of the bottom of the Raspberry Pi case and leaving the top open.

11 Assembled

My next task is to connect the wires from the LED light strip to the terminal block on the Codify board. The labels on the board make it very apparent which wires go where. Make sure you don’t leave any loose wires poking out of the terminal block that might short and cause an issue.

12 AttachLEDStripWires

To power the VSTS Build light we will need a 12volt DC power plug supplying somewhere between 1.5 and 2.5 amps. The range will depend on exactly how long you want your light strip to be. The 1.5A supply seems to drive my 80cm LED strip without any problems at all. I had to cut the plug off the power plug so I could strip the wires and tin them with a little solder. Attach these to the Codify board on the appropriate terminal block ensuring your observe the correct polarity.

NOTE: THIS POWER SUPPLY WILL RUN BOTH THE CODIFY BOARD AND THE RASPBERRY PI. You should not plug the standard micro-USB power supply into your Raspberry Pi.

13 12VDCPlugpack

Here’s where we end this first part of my three part series on building the Codify VSTS Build Light.

The next two parts will be as follows;

More Posts