We’re using the format #{Octopus.Date.Year}.#{Octopus.Date.Month}.#{Octopus.Date.Day}-#{Octopus.Time.Hour}.#{Octopus.Time.Minute}
as our release number, and our package is built using that.
We have an appsettings.json
file with a ‘Version’ value that we tried replacing using
"Version":"#{Octopus.Date.Year}.#{Octopus.Date.Month}.#{Octopus.Date.Day}-#{Octopus.Time.Hour}.#{Octopus.Time.Minute}",
It’s not too surprising this didn’t work, although it was odd to see the variable string left in place, so the user saw “#{Octopus.Date.Year}.#{Octopus.Date.Month}.#{Octopus.Date.Day}-#{Octopus.Time.Hour}.#{Octopus.Time.Minute}” as the version number!
So then I tried creating a project variable ‘Version’, setting that to the result of that expression, and using the variable #{Version}
in the Settings. (I’m not sure why there’s no variable builder in Settings/Release Versioning like most other places to validate input).
So now I assume I can use "Version":"#{Version}"
in appsettings.json, but no, it replaces it with the value “#{Octopus.Date.Year}.#{Octopus.Date.Month}.#{Octopus.Date.Day}-#{Octopus.Time.Hour}.#{Octopus.Time.Minute}” !!
Not only that, but clicking “Create Release” suggest “Version #{Version}” as the build number, which is obviously not going to work.
How is this supposed to be done?