I have a “Deploy a NuGet package” Step Template created with three parameters: PackageName
(single-line), DeploymentPath
(single-line), and ApplyWebConfigTransformations
(checkbox).
The ApplyWebConfigTransformations
parameter is bound to the “XML transforms” field of the “Configuration transforms” feature. The expression text field displays just fine when swapping from the checkbox to the Custom Expression, but once saved and reloaded, the text field no longer displays.
PS. At one point in time, the Post-deployment script (C#) was lost on two out of the four templates I have, however, I haven’t been able to reproduce this issue.
I am using version 3.0.5.2124 on Server and Tentacles, and the Tentacles have Calamari version 3.0.1.376…
Here’s the Step Template export:
{
"Id": "ActionTemplates-22",
"Name": "Deploy WebApi",
"Description": null,
"ActionType": "Octopus.TentaclePackage",
"Version": 5,
"Properties": {
"Octopus.Action.Package.NuGetFeedId": "feeds-builtin",
"Octopus.Action.EnabledFeatures": "Octopus.Features.CustomDirectory,Octopus.Features.CustomScripts,Octopus.Features.ConfigurationTransforms",
"Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles": "False",
"Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings": "False",
"Octopus.Action.Package.DownloadOnTentacle": "False",
"Octopus.Action.Package.NuGetPackageId": "#{PackageName}",
"Octopus.Action.CustomScripts.Deploy.ps1": "",
"Octopus.Action.Package.CustomInstallationDirectory": "#{DeploymentPath}",
"Octopus.Action.CustomScripts.PreDeploy.csx": "var deploymentPath = Octopus.Parameters[\"Octopus.Action.Package.CustomInstallationDirectory\"];\nvar filesToDelete = new[]\n{\n System.IO.Path.Combine(deploymentPath, @\"App_Data\\app_offline_template.htm\"),\n System.IO.Path.Combine(deploymentPath, @\"App_Data\\Documentation.htm\")\n};\nvar directoriesToDelete = new[]\n{\n System.IO.Path.Combine(deploymentPath, @\"bin\"),\n System.IO.Path.Combine(deploymentPath, @\"Public\"),\n System.IO.Path.Combine(deploymentPath, @\"Views\")\n};\n\nforeach (var file in filesToDelete)\n{\n if (System.IO.File.Exists(file))\n {\n System.IO.File.Delete(file);\n }\n}\nforeach (var directory in directoriesToDelete)\n{\n if (System.IO.Directory.Exists(directory))\n {\n System.IO.Directory.Delete(directory, true);\n }\n}",
"Octopus.Action.CustomScripts.PostDeploy.csx": "var deploymentPath = Octopus.Parameters[\"Octopus.Action.Package.CustomInstallationDirectory\"];\nvar filesToDelete = new[]\n{\n System.IO.Path.Combine(deploymentPath, @\"Web.Debug.config\"),\n System.IO.Path.Combine(deploymentPath, @\"Web.Release.config\")\n};\n//var directoriesToDelete = new[]\n//{\n//};\n\nforeach (var file in filesToDelete)\n{\n if (System.IO.File.Exists(file))\n {\n System.IO.File.Delete(file);\n }\n}\n//foreach (var directory in directoriesToDelete)\n//{\n// if (System.IO.Directory.Exists(directory))\n// {\n// System.IO.Directory.Delete(directory, true);\n// }\n//}"
},
"SensitiveProperties": {},
"Parameters": [
{
"Name": "PackageName",
"Label": "Package Name",
"HelpText": "",
"DefaultValue": "WebApi.",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Name": "DeploymentPath",
"Label": "Deployment Path",
"HelpText": null,
"DefaultValue": "C:\\inetpub\\web-api",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Name": "ApplyWebConfigTransformations",
"Label": "Apply Web Config Transformations",
"HelpText": null,
"DefaultValue": "True",
"DisplaySettings": {
"Octopus.ControlType": "Checkbox"
}
}
],
"$Meta": {
"ExportedAt": "2015-07-25T01:20:55.148Z",
"OctopusVersion": "3.0.1.2063",
"Type": "ActionTemplate"
}
}