Custom Build Tasks in VSTS

[Updated 16 Jun 2016 to reflect name change from VSO to VSTS][Updated 28 Dec 2015 to reflect latest changes in command line interface]If you’ve been making use of the new Team Foundation Build technology in Visual Studio Team Services (VSTS) or Team Foundation Server (TFS) 2015 then you might have wished you had the ability to create and upload your own custom build tasks. Well, that day is now here! You can now create a custom build task and upload it to your VSTS account for use across your build definitions. Caveat The ability to upload custom tasks is still…
Read More

Android: Two Weeks In

Well, it’s been two weeks since I officially switched to Android. I’ve been spending years (literally) reading other people’s accounts highlighting their experiences with switching from Windows Phone/mobile to Android and/or iOS (and occasionally the other way around). I figured this was my chance to finally put my initial thoughts and experiences on paper (so to speak) since I’ve been using Windows-based phones for a long time (10 years!).So, two weeks in, what have I learned? For the Clint Eastwood fans out there, I’ll break it down into The Good, the Bad and the Ugly.The GoodHardwareAs I mentioned in my…
Read More

Why Should I Leave XAML Builds?

If you have been using Team Foundation Server for any amount of time (say, 2 years or more) then it’s likely you have a decent investment tied up in your XAML-based builds. It’s likely that you have spent a lot of time tweaking the XAML ever-so-carefully to get your automated builds to do your bidding. It’s also possible that you have utilized multiple custom build tasks for scenarios specific to your organization that are not supported out of the box.Along with this, you and/or your team has gained a good amount of knowledge in learning how to tie the various…
Read More

When is Enough, Enough?

Ask anyone who has known me for more than a few hours and odds are they can tell you that I love technology! Specifically, I am a huge fan of the Microsoft software developer ecosystem. I was a Java developer before .NET/C# became available but, once I got my hands on C#, there was no going back (to Java)! To me, .NET & C# was what Java should have been from the beginning.Since those days, I’ve written many apps – web apps, “fat client” (Windows) apps and mobile apps. Since Windows Phone (7) came on the scene back in 2010…
Read More

VSTS-Tools ‘Keep’ Build Extension

If you are making use of Visual Studio Team Services (VSTS) to manage your automated builds then you are likely already aware that completed builds are kept for a maximum of 10 days by default. You can increase the default up to 30 days but no longer (using TFS on premises gives you more control over the retention). If you want to keep your build artifacts longer than the maximum 30 days allowed, you must set the retention for the build to “keep forever”. There are some cases where it makes sense to automate this task – e.g. you’re calling…
Read More

VSTS-Tools Build Extensions

Last week I wrote about how you can make use of PowerShell to log extended diagnostics information when running a build. The two examples I included showed you how to collect environment variable information (e.g. names and values) as well as list (recursively) folders and files beneath a specified folder. As an additional exercise, I decided to convert these two examples to build tasks and publish them as the VSTS-Tools extensions.The VSTS-Tools extensions currently includes two build tasks:VSTS-List FilesVSTS-List VariablesVSTS-List FilesThis extension will list out (in the log) all files beneath the folder specified as the Root Folder. There are…
Read More

Get (more) Build Agent Details with PowerShell

Chance are you are already aware that you can use the system.debug variable with your builds to get diagnostics-level information (i.e. verbose) when running your builds. If this is news to you, then try setting system.debug to true in the Variables tab for one of your build definitions and run the build.   After running the build, check the build log and you will notice a lot of extra information that wasn’t there before. This is great for getting a better understanding of what is going on behind the scenes when your build runs. However, keep in mind that some…
Read More

VSTS-Tools now on GitHub

Several of the past few posts that I have published have revolved around various Visual Studio Team Services (VSTS) REST API calls (you can click on the “View API Articles” button to the right to view the list of articles). Rather than relying purely on blog posts to provide example source code for these REST API calls, I thought I’d start making them available in a GitHub repo.Introducing VSTS-Tools!You can find the initial release on GitHub here: https://github.com/jbramwell/VSTS-ToolsThe initial release contains code examples for two command-line utilities:VSTS-Get – CLI to download a single file or entire folder tree from VSTS…
Read More

Download a File using VSTS REST APIs

Adding yet another post related to Visual Studio Team Services (VSTS) REST APIs, I thought I’d cover an example of how to download a file from a Git repo in VSTS using the REST APIs (I will cover TFVC-based repositories in another post). In the example below, I will be using C# to make the API calls. However, you can use whatever approach makes the most sense for you (e.g. JavaScript, PowerShell, etc.).If you are new to calling the VSTS REST APIs or you are new to this series of articles then I would recommend on clicking the View API…
Read More

Calling VSTS APIs with PowerShell

Continuing along with my other various examples of VSTS API calls, I thought I’d include an example on how to call a Visual Studio Team Services REST API using PowerShell.To provide a concrete example, consider this scenario:We use VSTS-based builds to build our projects and create artifacts (e.g. web apps/services, binaries, etc.). We then make use of Octopus Deploy to deploy our artifacts into our various environments (e.g. development, test, production, etc.). Once these artifacts have been deployed to the production environment, we’d like to keep them around indefinitely.As you are likely aware, VSTS has a default retention policy on…
Read More