Transform file not working for Service windows

resolved
server
usability
known
(Yassine Kerkeni) #1

I deployed my package in this path
image

my configuration transform file in octopus

but not working :frowning:

(Tina) #3

Hi Yassine,
Sorry to hear your config transforms are not working as expected.

If possible can you send me the Octopus Server version you’re running and the Raw Task log from deployment which is not transforming the configuration correctly?

Is it possible that there is a mismatch in the naming convention of your Octopus Environment and that of the corresponding config transform? As an example if your package contains the configs below when deploying to an environment named " Test ", Octopus will execute the transforms in this order: YourService.exe.Release.config , followed by YourService.exe.Test.config, matching the environment from the config to the environment in the Octopus.

  • YourService.exe.config
  • YourService.exe.Release.config
  • YourService.exe.Test.config

Here’s a couple of links to our Config Transform documentation and our troubleshooting guide for more information.


I’ve made this a personal message to protect any sensitive information you may send through in your task logs, but if you’d rather send them to our secure email at support@octopus.com that’s fine too.

Thanks for reaching out and I look forward to hearing from you shortly.

Kind Regards,
Tina

(Yassine Kerkeni) #4

Hello,

I’m using Octopus :
V2019.13.7

Now it’s working
:blush:

I thought it was replacing the contents of one file with another.

For example replace :

All content of file
YourService.exe.Release.config

By
YourService.exe.Release.config

But the correct behavior is you must use the syntax: XML-Document-Transform for the sections to replace.

Is not possible to replace the contents of one file with another ?

Other question : In my package I have SQL script (insert, update, create ) I need to execute it by Octopus have you link to help me for this ?

Thanks All
:blush:

(Tina) #5

Hi Yassine,
Glad to hear you were able to get this working. Your current understanding of Transform replacement is correct. Replace the contents of one file with another would require some custom scripting, as there’s no such feature out of the box. If you are just replacing one file for another you might want to rename the file, which you could do using a script inside of the package step and Rename the file.

As for running SQL scripts from your package, you do this by utilizing the “SQL- Execute Script File” Step seen below.

The SQL Script File section in the step configuration expects a path to the script file. You can get the path that your package installs to by using an output variable, which would be followed by your script file name. In your SQL Script File section, the value should look like the following (input your script file name):
#{Octopus.Action[Deploy Package].Output.Package.InstallationDirectoryPath}\ScriptFileName.sql

I hope this helps! Let me know if you have any further questions going forward.

Kind Regards,
Tina

(Yassine Kerkeni) #6

Thank you for your response, the configuration of the name file works: smile:
About the SQL script, the octopus executes all files in “Path to script files” but in descending order
I’m used “Reg Ex Version File Name” but i d’ont know how to put syntax for sorting files
I would like execute my files in this order :
1-xxxx.sql
2-xxxx.sql
3-xxxx.sql

Thanks