I’m having trouble acheiving something. What I want is to have my Git short hash included in the version number of my app (injected into appSettings in my web.config), like this 5.0.1.b6f62e5. So far I’ve failed to acheive this.
First attempt was to include the hash in the build number set in TeamCity using a powershell script, then I could just reference it easily from within Octopus and inject in into my web.config. This seemed to be working fine in teamcity but when I attempted my first deploy I got the error “error OCTONUGET: ‘5.0.1.b6f62e5’ is not a valid version string” - presumably because of the letters?
Second attempt was to pass the git hash from TeamCity to Octopus as prompt variable using command arguments. Works great for the first deployment in the lifecylcle but then it asks for the value on all subsequent deployments in the release. OK but not ideal, I want this done automatically really.
Third attempt was to try and set the value as an output variable but I soon figured out that again that would only work for a single release.
Any easier way to do this? Can I have a prompt variable that gets persisted through the whole lifecyle?