Is it possible to make a deployment fail if un-substituted tokens are found in configuration files?
I have several projects with large variable sets and we want to ensure that each token defined in configuration files is properly substituted in each environment. If for some reason a token is found with no valid value for an environment, then fail the deploy, reporting on the missing value.
To be clear, I’m specifically talking about the variable substitution feature of the nuget package deploy since we modify values outside of the appSettings and connectionStrings sections as well as in them.
If this feature doesn’t exist, maybe a feature request?
I’m still in the initial idea phase here, but the trick will be to catch this issue BEFORE the application is actually deployed (custom installation directory). So the process would look something like this:
- Package download
- Unpack in Octopus Tentacle directory
- Variable Substitution
- (NEW) validation of all tokens substituted (if any found to be un-substituted->FAIL deploy)
At this point, nothing in the actual installation directory has been modified, so the previous deployment should not be overwritten. I’m thinking maybe a validation checkbox on the variable substitution form.
[ ] Fail deployment if un-substituted tokens are found
Thank you for reaching out! This is an interesting idea, though currently it’s not possible to fail a deployment due to un-substituted tokens. There’s a UserVoice suggestion to implement it, so go give it a vote!
There’s a really cool blog post written by an Octopus user that they shared with us, which you may find useful! It details the steps to allow you to see all of the changes that would occur in your config files during a deployment, without actually deploying.
I hope that helps!