We are currently running v.3.17.4. I have setup a sandbox server testing out v.2018.3.4.
Using the octopus.migrator.exe, tool I have recreated several deployment projects and am noticing some failures referencing variables via PowerShell on the new version.
Example 1:
My project has a project-specific variable called ‘DirAgl’
Then Step 1 runs the following powershell:
$AGLName = $OctopusParameters[‘DirAgl’]
Write-Host “Lets determine the primary AGL Node for:” $AGLName
$activeNodeName = invoke-sqlcmd -ServerInstance $AGLName -query “Select ServerProperty(‘ComputerNamePhysicalNetBIOS’)” | select -expand Column1
$activeNodeHostName = $activeNodeName+“.”+$OctopusParameters[‘Domain.Hostname’]
Set-OctopusVariable -name “ActiveDirNode” -value $activeNodeHostName
Write-Host “The primary AGL Node is:” $activeNodeHostName
When I run this in v.2018.3.4, the project specific variable does not get pulled in to the script and it fails. However this exact same scenario works just fine in v.3.17.4.
Log:
ServerTasks-2217.log.txt (8.3 KB)
Example 2:
I have a Transfer Package step where the Transfer Path =
#{Octopus.Tentacle.Agent.ApplicationDirectoryPath}#{Octopus.Action.Package.PackageId}
For a given package named: ‘LogsToElastic.Lambda.1.0.359.nupkg’
the transfer step is creating:
'C:\Octopus\DevDeploy\Files\LogsToElastic.Lambda@S1.0.359@5DE1861E0FB7614FAC6D7980C1D795A8.nupkg’
Thus my subsequent step is referencing ‘package.packageID’ is failing:
$path = $OctopusParameters[‘Octopus.Action[Copy Package to Agent].Package.TransferPath’]
$packageId = $OctopusParameters[‘Octopus.Action[Copy Package to Agent].Package.PackageId’]
$packageVersion = $OctopusParameters[‘Octopus.Action[Copy Package to Agent].Package.PackageVersion’]
$nuGetFileName = “$path$packageId.$packageVersion.nupkg”
$zipFileName = “$path$packageId.$packageVersion.zip”Copy-Item -Path “$nuGetFileName” -Destination “$zipFileName”
Log: ServerTasks-2490.log.txt (12.8 KB)
I would like to re-iterate that the code running on both versions is literally copy-pasta from one to the other and fails only on the newer version.