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…
Please see the below script which i am using
$domainURL = “#{environmentWebBinding}”
$ContentModulesPath = “#{folderPathWeb}Content\Modules”
$GlobalScriptsPath = “$ContentModulesPath\Global\scripts”
$GlobalConfigurationFile = “$GlobalScriptsPath\configuration\GlobalConfiguration.js”
$EntityCMSDataServiceFile = “$GlobalScriptsPath\entities\Entity_CMS_DataService.js”
$EntityMemberDataServiceFile1 = “$GlobalScriptsPath\entities\Entity_Member_DataService.js”
(Get-Content ($GlobalConfigurationFile)) | ForEach-Object {$_.replace(‘localhost’, ‘#{environmentwebbinding}’).replace(‘localhost’, ‘#{environmentwebbinding}’)} | Set-Content -Encoding UTF8 ($GlobalConfigurationFile)
$EntityCMSDataServiceFile = “$GlobalScriptsPath\entities\Entity_CMS_DataService.js”
(Get-Content ($EntityCMSDataServiceFile)) | ForEach-Object {$_.replace(‘localhost’, ‘#{environmentwebbinding}’)} | Set-Content -Encoding UTF8 ($EntityCMSDataServiceFile)
$EntityMemberDataServiceFile1 = “$GlobalScriptsPath\entities\Entity_Member_DataService.js”
(Get-Content ($EntityMemberDataServiceFile1)) | ForEach-Object {$_.replace(‘localhost’, ‘#{environmentwebbinding}’)} | Set-Content -Encoding UTF8 ($EntityMemberDataServiceFile1)