Transformation of Javascript files

As part of automation using octopus, im trying to transform java script files. In this case, I’m able to transform with variable names. But coming to octopus, the variable values are not updating based on variables which we gave in octopus…

transformationoctopus.txt (1.1 KB)

I have attached the script which i am using .
please help me out with the solution

Hi Siddhartha,

Thanks for getting in touch! I’m sorry to hear you’re hitting this delay getting these variables in your JavaScript files substituted! Unfortunately I’m unable to determine right away what the cause of this could be. You’re using the correct syntax in that text file you sent. As long as there’s a matching variable name defined in your project (which is correctly scoped to where you’re deploying), and you’ve specified the file name in the Target files section of the Substitute variables in files feature, these variables should be substituting properly.

Can you confirm you have it set up in that way? If everything checks out, would you be willing to provide a copy of your verbose deployment logs with debugging variables enabled? This will provide lots more insight to help us diagnose the root cause. The following doc page outlines how to produce and export this log. :slight_smile:

I look forward to hearing back and getting to the bottom of this one!

Best regards,


Hi Kenny,

I haven’t used “Substitute variables in files” feature for the Step where we are trying to Replace Variables. Because, we have written script to replace the variables on fly for JS files.

please look into the attached logs. let me know your availability to have call or can i have your bridge number to overcome this issue.


I haven’t used “substitute variable in files” feature to replace the variables. Because, here we are using script “(Get-Content ($GlobalConfigurationFile)) | ForEach-Object {$_.replace(‘localhost’, ‘#{environmentwebbinding}’).replace(‘localhost’, ‘#{environmentwebbinding}’)} | Set-Content -Encoding UTF8 ($GlobalConfigurationFile)” to replace the value with variable declared in octopus.

So, please look into the attached logs and let me know your availability to take a call or provide me bridge number to connect.

So that it will help me to resolve the (242.1 KB)

we are waiting for your reply from past one day and this is affecting all the clients and we are not able to move forward .

please share your contact details so that we can contact you directly, is there any way to communicate ?

Hi Siddhartha,

Thanks for following up. I’m just letting you know here that I’ve replied to your new question, and my colleague replied to a question I assume was written by an affiliate of yours here. :slight_smile:

Best regards,


Hi Kenneth Thanks for your update ,
As mentioned by your colleague i have tried

  1. Added new job to replace Env variable in JS files. It is happen successfully. So in this case, we can try replacing values as same configs for JS files using octopus.
  2. Added **/*.js in Substitute variables in files feature.
  3. Disabled Replace JS file steps in octopus.
  4. When I tried only the job which I configured, it is successfully transforming. Its not picking values from octopus please check.
    The octopus is not picking values.

The Values got picked at first time of deployment, but again when created deploy with new release it didnt pick the values .
Can you please help me out in this.
Please check the server logs (278.1 KB)

HI Kenneth,

I Have upgraded latest version of octopus,And still the same the files are not getting transformed,.

Please provide me ur suggestion.

Hi Siddhartha,

I’ve been following the thread that Jim has been assisting on, and it’s great to hear that the JavaScript files are transforming as needed! Please don’t hesitate to reach out if you have any further questions in the future.

Best regards,


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.