Confirming that conditional statements are still not possible from Features/Additional Transforms sub step.
I’d like to be able to conditionally apply a transform to a subset of deployment targets scoped by environment. e.g. Staging and Prod environment deployments only.
e.g. if #{Tenant.RunConditionalConfigTransform}
ConditionalConfig -> Web.Config
Thanks for getting in touch. Conditionally applying transforms for the deployment target is not supported. We think to achieve the outcome you’re after it would be best to use Octopus variables, have the transformation populate configuration files with Octopus variables that you then define different values by scoping values for the deployment target.
Hi
Actually what I’m trying to acheive is applying a set of transforms only to Staging and Production and not QC environments. So it’s not the scoped values that are solely of interest. It’s issues such as adding or removing various elements to both Staging and Production configs. If I were able to configure the conditional application of a common Staging/Prod transforms, it would allow me to not have to copy same transforms into multiple transform files.
I also have to use Additional Transforms as Visual Studio’s naming convention for app.config doesn’t work well with Octopus’ convention. No big issue. Just noting I’m not using the default transform process. But something like: {VsAppConfigTransformFile} => app.config in Additional Transforms.
If there’s another way to acheive this please let me know.