Hi Team,
I am working on a task where while deploying if release version number doesn’t match with the package number then the deployment should fail.
I am using octopus system variables “$OctopusParameters[“Octopus.Release.Number”]” to get the release number and “$OctopusParameters[“Octopus.Action.Package[Version-Number].PackageVersion”]” to get the package version number being deployed.
But the variable “$OctopusParameters[“Octopus.Action.Package[Version-Number].PackageVersion”]” is not able to resolve to actual value, instead it gives a null value.
in the above attached image i have even given the referenced package, and have wriiten a powershell script to print the values.
it can be seen that in the above image the package number is null value while release number has resolved with actual value.
Can you please help me out with this, so that i can get the Package number being deployed.
NOTE: WE ARE DEPLOYING MULTIPLE PACKAGES (all with same package number) IN A SINGLE APPLICATION, BUT I HAVE GIVEN ONLY ONE PACKAGE FOR REFERRED PACKAGE AS SEEN IN THE ABOVE IMAGE
I HAVE EVEN TRIED USING “$OctopusParameters[“Octopus.Action.Package.PackageVersion”]” VARIABLE, BUT THIS ALSO IS NOT ABLE TO RESOLVE THE ACTUAL VALUE
this is the powershell script which i am using :
$packagenumber=$OctopusParameters[“Octopus.Action.Package[Version-Number].PackageVersion”]
Write-Output “Package Number: $packagenumber”
$releasenumber=$OctopusParameters[“Octopus.Release.Number”]
Write-Output “Release Number: $releasenumber”.
Can you please help me out with this, or is there any better approach for getting the package number being deployed.
It would be of great help if a solution is provided for this.
Thanks,
Shaik Sadiq