I believe that I have followed http://docs.octopusdeploy.com/display/OD/Substitute+Variables+in+Files correctly, however when the deployment runs. the variable in the .Z_Project.ci.config file is not being set. and then when Z_Project.config is being transformed it end up with the variable name instead of the value.
Could you please follow the below steps to provide a verbose deployment log? It’ll help knowing what happened during your deployment.
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
I’m wondering if this isn’t working because the target you included ( App_Config\Include\Z_Project.#{Octopus.Environment.Id}.config ) has #{Octopus.Environment.Id} instead of #{Octopus.Environment.Name}
The below fragment of your log shows the value during the deployment of each of those variables
I made the change you suggested and now everything is working. (Until I add more steps in )
I was creating a library step and have updated the Substitute variables in files to be App_Config\Include\Z_#{Octopus.Project.Name}.#{Octopus.Environment.Name}.config so that it is now fully reusable for me