Dynamic Teamcity package name

I have a process step to apply a nuget package for my solutions. The name of this package is different for each deployment and I wanted to use a variable to get the package name. See configuration below. It doesn’t seem to use the variable when building the deployment

{
“Id”: “1aaac053-b9ac-441e-bb09-83455d015b89”,
“Name”: “Product Branding”,
“ActionType”: “Octopus.TentaclePackage”,
“Environments”: [],
“Channels”: [],
“Properties”: {
“Octopus.Action.EnabledFeatures”: “Octopus.Features.CustomScripts”,
“Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles”: “False”,
“Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings”: “False”,
“Octopus.Action.Package.DownloadOnTentacle”: “False”,
“Octopus.Action.Package.NuGetFeedId”: “feeds-teamcity”,
“Octopus.Action.Package.NuGetPackageId”: “#{ImagePackageName}”,
“Octopus.Action.CustomScripts.PreDeploy.ps1”: “$path = $OctopusParameters[‘Octopus.Action[Product Branding].Output.Package.InstallationDirectoryPath’]\n$packagename = $ImagePackageName\n$filename = “branding\”+packagename+”.zip"\n\n$dest = “E:\Projects\” + $OctopusParameters[‘Octopus.Project.Name’] …if (Test-Path $fullpath)\n{\n \n $zip_file = $shell_app.namespace("$fullpath")\n $destination = $shell_app.namespace("$dest")\n $destination.Copyhere($zip_file.items(), $FOF_SILENT_FLAG + $FOF_NOCONFIRMATION_FLAG)\n}\nelse\n{\n Write-Host File $fullpath does not exist\n}\n"
},
“Links”: {}
}

Hi,

Thanks for reaching out. Is the deployment failing at a specific part? Could you follow the below steps and send us a full deployment log?

1) Add these 2 variables to your project http://docs.octopusdeploy.com/display/OD/Debug+problems+with+Octopus+variables

2) Create a new release (so the new variables take effect) and deploy it. If possible skip as many steps as you can and only leave step we are troubleshooting in order to avoid the noise in the log.

3) Send us the raw log of that deployment http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Along with the log, please send a screenshot of your Project’s variables screen where we can see all the copies of the variable ImagePackageName that you created.

Thanks,
Dalmiro

So the issue that is failing is I’m using a variable for the package name that I want to retrieve from Teamcity.
“Octopus.Action.Package.NuGetFeedId”: “feeds-teamcity”,
“Octopus.Action.Package.NuGetPackageId”: “#{ImagePackageName}”,

The problem is it doesn’t seem to use #{ImagePackageName} when it tries to get the file from TeamCity.

  • How are you passing the value to #{ImagePackageName}
  • Do you have an unscoped version of that variable so Octopus can use it to create the release?
  • Could you please send the Log file so i can get a better idea at what is going on? If possible only run the deploy step during the deployment to avoid the noise in the log.
    -Along with the log, please send a screenshot of your Project’s variables screen where we can see all the copies of the variable ImagePackageName that you created.