One of our development teams is using Git and Gitflow with Continua. Gitflow branches are formatted ‘feature/feature1’, ‘feature/feature2’ and accessible through the property $Build.BranchName$.
However, our builds are stored on a networkshare and we’re using the branchname as subfolder. Since Gitflow branches contain a slash (’/’) character, this will actually lead into another subdirectory when using a gitflow branch name in a pathname.
e.g. Output path: \server\share\releases$Build.version$.$Build.BranchName$ will lead to different paths (and path depths) for master branch and feature branches:
Looking for advice/smart solution in this matter. We can always get rid of Gitflow or change the feature structure, but probably would be better to solve this another way. We haven’t found any “Continua way” solution yet. Within variables or properties you cannot regex or replace strings/characters (as far as I am concerned). “set variable” allows replacement of variables, but this is merely a rewrite. Even though you can append, you cannot replace.
We may add string manipulation functions in the future. For now, you will need to do this using FinalBuilder project, batch file, Powershell script or another external program. A FinalBuilder project with String Replace and Continua CI - Set Variable actions would be the simpliest to manage.
Alternatively you can use the following example PowerShell script:
This way you can have an initialization stage where everything is prepared for the builds. If you define these variables, they will be filled for you automatically: