Easy way to upload TFS 2015 build tasks (using TFX)

First of all, we are talking about TFS 2015 build tasks, TFX tool and powershell tasks.

What do you need?

  • TFX installed
  • json file
  • ps1 file
  • full TFS access

 

How to authenticate with TFX:

I’m using basic authentication,

tfx login –auth-type basic

It will ask for:

Service-URL: http://tfs.yourdomain.com:8080/tfs

Username: domain\ID

Password: password

 

Once authenticated, go to the folder where your files are and execute this command to push all to the server:
tfx build tasks upload –task-path .\

 

The json file

Use another task as base for your new task, you must set a new GUID for your new task, it will identify your task. You must increase the version before each upload. And you can define the GUI in this file.

[RM-Tools] xCopy Deployer x Custom xCopy Deployer?

Today I was using the built-in xCopy Deployer from Release Management, then I notice that everytime I was copying files, it was copying the whole folder structure.

It happens because the RM tool xCopy Deployer add by default the parameter /e, which creates the folder structure for you, even if you don’t need it.
To make it more flexible, I created a new xCopy tool, called xCopyPS, because it’s in Powershell Alegre

image

For me it’s better to define what are the custom parameters for it, instead of having a common behavior and some extra folder left in my destination folder.

Also you may create it not using powershell, in that case the log file won’t be so nice Smiley piscando

Source code in ps1:

################################################################################## # Define input parameters. param ( [string]$SourceFileFolder = $(throw File or folder name must be provided.), [string]$DestinationFileFolder = $(throw File or folder name must be provided.), [string]$CustomParams = “” #“for example: /y/i/e/f” ) cls ################################################################################## # Output the logo. xCopy PowerShell RM tool xCopy using PowerShell and with possibility to use System Variables It may run all params accepted by the xCopy using the CustomParams Created by Fabio Stawinski.`n ################################################################################## # Output execution parameters. Executing with the following parameters: SourceFileFolder: $SourceFileFolder DestinationFileFolder: $DestinationFileFolder CustomParams: $CustomParams`n Command: xcopy $SourceFileFolder $DestinationFileFolder $CustomParams &xcopy $SourceFileFolder $DestinationFileFolder $CustomParams

Release Management–First impressions and Bugs

It’s been quite nice since I started playing with Release Management (RM), and then of course some bugs were found and now I already have some impressions about the whole thing.

Components and Release Templates are shared

So, if you want to have a central RM server, be sure it is goind to share your components and release template with all users. Also some other things are shared, and it makes quite hard to manage a centralized server.

Release Template build def picker is not good

If you try to select a team project, it list all you have access, in my case I have full access to our server, then I can see them all. The big problem is that it’s not ordered, it’s hard to find the project you wish.

Also if you have two aliases for the TFS servers, if you select one and try to change it later for the second, it’s impossible, for some reason the RM keeps always the first selection. This I consider a bug, but we worked around, adding another server, setting all release templates for the new server, removed the server we were willing, and then selecting the new tfs server.

image

Permission errors even with the proper permissions set

This is another annoying issue. We have two Build servers, in on RM was working and in the other it wasn’t. They have the same setup, same users, permissions, folders, software, all the same. When I was trying to deploy from the build it was showing a message that the build service users has no permission to deploy. In fact the user was added as Release Manager in RM tool.

The “Great” solution: Log in the build server, open the RM client and then connect once in some RM server. It makes the deploy work fine. Until no idea why we should do that, but seems to be another bug.

 

Until now, it was all bad thing I found. And I do really think that this tool is fantastic but has lot of room for improvements and fixes.