Wednesday, August 10, 2016

Handling spaces in Git Urls using TeamCity

If you are using Team Foundation Server/Visual Studio Online for your Git repository, there is a good chance that you may end up with spaces in your Git repository Url!

This is because TFS/VSO uses the Project Name as the method to generate the Git repository Url.

Unfortunately, this presents an immediate problem for TeamCity because spaces in Urls are translated as the %20 character!  Once you run a build in TeamCity with a Url containing these characters, the build on the build agent will fail with an error such as this:

"20Reports defined in VCS Root: VSO Reports"

Thankfully, there is a solution to this problem even though it is not perfect. To workaround around this problem, you simply escape the %20 characters with an additional % sign like so in your VCS Url:

VSO%%20Reports

This should resolve the issue with being able to execute a build with a VCS Url that contains spaces.

However, you may still end up with an error message like this in your build log beneath the Artifact dependencies:

Parameter "20Reports" is undefined

You can ignore this error message in the build log, but hopefully the Jetbrains TeamCity development team will fix this issue completely in the near future!




No comments:

Post a Comment