Centralised scripts location
I was thinking it would be useful to have a centralised location in TeamCity for storing all my build script (*.ps1). The obvious solution is just to add it to project source control, but that can get messy if you want to update many different branches with a new build script. I also look into added a second VSC to the Build configuration, but produce weird build result with the wrong branch names. Any advice?
Please sign in to leave a comment.
The usual way to accomplish this is to store the settings in version control via the Versioned Settings ability in the project page: https://confluence.jetbrains.com/display/TCD18/Storing+Project+Settings+in+Version+Control
On the other hand, I'm not sure how your build scripts are set up. If you are using powershell scripts as .ps1 already, they are usually picked up from the repository, so I'm assuming that you already have them in the repository and what you want to do is move them to the server. You could integrate them directly in the build step, copying the contents of the scripts into the step, changing it from ps1 files to script content instead.
TeamCity should also be able to handle more than one VCS Root just fine. If you want to keep different configurations for different branches it should also be possible to do. If you would like to try that we can look into your branches issue, but if you only need one set of scripts for all branches, then you don't need to set up branches in the vcs root for the settings, just keep it in a default branch and not add any branches to that VCS root in TeamCity.
The more simple approach is also often used, of having a second VCS Root where the build scripts are stored. If you would rather use that system and keep having issues with the branches, it would be useful if you could provide a bit more detail into what the issue exactly is, as this should work just fine.