asmagin / Cake.Sitecore

The library provides a set of pre-build CAKE tasks. Those tasks could be used to simplify a configuration of CI/CD for Helix-based Sitecore projects.
https://cakebuild.net/addins/sitecore/
MIT License
11 stars 12 forks source link

wrong definition of VERSION parameter in case of non-release branch #24

Closed artyom-krot closed 6 years ago

artyom-krot commented 6 years ago

Issues: 1) in the private static string GetVersion(string defaultValue) BuildID var is not defined. 2) If we have non-release branch VERSION parameter will be defined as VERSION = 0.0.0-develop. From parameters.cake

if (!BranchName.IsRelease()) {
                return $"{version}-{Git.GetTagFromBranchName(BranchName)}.{BuildId}";
            }

That is wrong. Version should be in format 0.0.0 for any branch.

3) It causes next issue with AssemblyVersion parameter, cause it defined as {VERSION}.0 and we will get 0.0.0-develop..0 Build fails in case of non-release branch

Suggestions: remove from parameters.cake if (!BranchName.IsRelease()) { return $"{version}-{Git.GetTagFromBranchName(BranchName)}.{BuildId}"; }