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…
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.
I look forward to hearing back and getting to the bottom of this one!
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.
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.
Hi Kenneth Thanks for your update ,
As mentioned by your colleague i have tried
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.
Added **/*.js in Substitute variables in files feature.
Disabled Replace JS file steps in octopus.
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
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.