Overwrite configuration files

Hi,

I think there is a lack of overwriting files. There is a step template for configuration transform, but this is only working for XML syntax. How about having other types of files to be overwritten when deploying.

Scenario -
Configuration.conf - contains configuration for local
Configuration.Environment.conf - contains octopus variables which is overwritten(Substitution in files step template) by Octopus when it deploys.

It seems I can not do this.
I know it is a single line in powershell which I can do by my self and put in PreDeploy.ps1, but like the transformation step template, I want a text area field where I can list my files I want to overwrite. This will help to keep the features in Octopus process and not customizing.

I think it is an easy step template to make, please make it available.
Or is it available today which I have not discovered?

Regards,
Mehmet

Hi Mehmet,

Thanks for getting in touch! Octopus does do these additional file transformations as a feature that you can enable from our inbuilt package steps. You can enable this feature by first selecting Configure features then ticking the Configuration transforms feature box. Once selected you will be able to use the Additional transforms section that will now be available for your step to specify these transformations.

These additional transforms also work with variables that you scope to a particular environment.
As an example you can then enter into the Additional transforms box the following:

Configuration.#{Octopus.Environment.Name}.conf => Configuration.conf

Where #{Octopus.Environment.Name} would be a variable that resolves to your environments based on its scoping. (This is not limited to environments and can be any Octopus variable needed)

In our documentation we cover this in depth with screen shots that show where and how this is done.
http://docs.octopus.com/display/OD/Configuration+files#Configurationfiles-ConfigurationTransformation (Look under Additional Configuration Transforms)

Let me know if that helps or if you have any further questions.

Regards,
Daniel

Hi Daniel,

I have read the documentation but there is a culprit. As stated in the
documentation, “transform definitions on any XML file with any file
extension”, what if my file is not an XML file?

We need something to overwrite whole file. Like the existing “Substitute
variables”, but “Substitute files” instead. I hope you can understand my
finding.

/Mehmet Karahan

Hi Mehmet,

Thanks for getting back with this, it looks like I misinterpreted your original question. We are curious as to know what kind of file you are trying to transform?

In Octopus we support transformations of XML or JSON files. If you are using neither XML or JSON files then you will need to go with your original plan of using PowerShell in the PreDeploy.ps1 script.

Looking forward to hearing from you. :slight_smile:

Regards,
Daniel

Hi Daniel,

It is a master page with SharePoint elements wrapped with Bootstrap and custom css, js and image url’s. The syntax is XML but not as Web.Config. So I would overwrite the whole file, but this not important because the feature is not there.

Sometimes overwriting files is easier instead of making a complex transformation file.

Right now it is done with a PreDeploy.ps1 script, but sadly it could be much more nicer if it was a part of the process in Octopus UI as transformation process step feature.

Elegance makes the soul feel calm :wink:

Regards,
Mehmet

Hi Mehmet,

Thanks for getting back with this. I think a good avenue here if you would like to see something like this implemented into Octopus in the future would be to check out UserVoice. You can make a suggestion and if there is enough community support for it, the team can look at options to make it a feature.
https://octopusdeploy.uservoice.com/

Please let me know if you have any further questions or run into any issues. :slight_smile:

Regards,
Daniel