Populate release_version and/or package_version?
$SqlCmdVersionVariables = @{ReleaseVersion = "1.1.0-build 1"}
NewDatabaseRelease ... -SqlCmdVariables $SqlCmdVariables
However, I'm currently not using direct powershell scripts in my process. I'm using the step templates in octopus.
How do I get octopus to populate these columns?
TIA,
-Peter
Best Answers
-
PeterDaniels Posts: 89 Bronze 3
Thanks, team. Monday, I saw that part of the docs and assumed it meant that ReleaseVersion would be automatically populated, but that was not happening. I got it working by manually creating a variable in Octopus - ReleaseVersion, and setting it to #{Octopus.Release.Number}
Now, I'm seeing it populated in the dbo.__MigrationLog table (e.g. "1.1.0-build22")
Which came from Bamboo via the Package Version: 1.1.0-build${bamboo.BuildNumber}. Making some progress...
Now, I just want to find the right way to populate the "1.1.0" in Bamboo from the SCA project...probably another post, tho...
-
Mike U Posts: 316 Gold 1The automatic sourcing actually only happens for the older ReadyRoll way of creating an Octopus package (where the .nupkg is created as part of the Visual Studio build - https://documentation.red-gate.com/sca3/automating-database-changes/automated-deployment-with-sql-change-automation-core/using-octopus-deploy-with-sql-change-automation-core).
When you're using the newer SQL Change Automation step templates this doesn't happen automatically at the moment.Development Lead
Redgate Software
Answers
Redgate Software
Edit: I created an Octoput variable, ReleaseVersion and set its value to:
#{Ocopus.Release.Id}
This just set it to Release.26, even though the name of the release was 1.1.0-build22...looking for another var...
Release number to store against deployed migrations within the [dbo].[__MigrationLog] table. There is no default value for this variable; a warning will be emitted during deployment if it has not been set.
The exception to this is when deploying with Octopus, in which case the value is automatically sourced from the Octopus.Release.Number system variable.
-Peter