Transform pattern no matching files

The transform pattern “website\Web.Release.config => website\Web.config” was not performed as no matching files could be found.
For detailed diagnostic logging, please set a variable ‘Octopus.Action.Package.EnableDiagnosticsConfigTransformationLogging’ with a value of ‘True’.

Where does one actually set this variable?

Also. I’ve set
Web.Release.config => Web.config
website\Web.Release.config => website\Web.config
#{installationRoot}\website\Web.Release.config => #{installationRoot}\website\Web.config

None work

Hi Bill,

Thanks for getting in touch! You can set this variable as a standard project variable (leaving it unscoped), and create a new release to apply the change, and then deploy it. Why those additional transform rules don’t work, I’m unable to determine currently. To help me understand your scenario a bit better, would you be willing to provide some additional details?

Where are the transform and config files located within your package’s directory structure?
Are both the files within the same package?
If these files exist within separate folders or packages, the following doc page covering advanced configuration transforms examples may be of help. :slight_smile:

Any and all additional details would also be appreciated!

Kind regards,

Kenny

Hi Kenny,

Thanks so much for you reply.
I set the variable in the variables section and it gave me more information, all good.

I found the problem. The package is exploded in the Octopus Tentacle under …
C:\Octopus\Applications\ENT-DEV\vrl8.rxp2p.ENT-DEV\0.0.89_9
Within this directory transformations and substitutions take place
The package is then copied to the path as defined “Custom Install Directory” which in our case is…
D:\Sitecore#{Website}#{Branch}#{Octopus.Release.Number}\

Unfortunately, this does not work with how we are doing our deployments.

  1. We install a vanilla version of sitecore into
    D:\Sitecore#{Website}#{Branch}#{Octopus.Release.Number}\
    • This contains a vanilla web.config file
  2. We then deploy our release to this directory
    • The package is exploded in c:\octopus\Applications
    • the release doesn’t contain a web.config file…
    • this exists in the deployment target…
      D:\Sitecore#{Website}#{Branch}#{Octopus.Release.Number}\
    • so the transforms wont work of course because there is no web.config file to transform
    • So then the package is deployed to
      D:\Sitecore#{Website}#{Branch}#{Octopus.Release.Number}\

How do we work around this?

Kind Regards
Bill

Hi Bill,

Thanks for following up and providing those additional details. Since the web.config file doesn’t exist in the package you’re deploying, unfortunately this won’t work. It would require defining an absolute path to the web.config, which isn’t possible (only absolute paths to transform files can be done).

Since it looks like the package is being copied to the same directory (via custom installation directory) as your vanilla version of sitecore, I imagine what would work would be to add the web.config into the package itself that’s deployed by Octopus, and your deployments should recognize and transform your web.config file.

Let me know if this helps get you going!

Kind regards,

Kenny

Hi Kenny. We thought of that but it upsets the de-coupling of the deployment vs the vanilla copy of sitecore. If we patch the vanilla sitecore, we would need to consider bundling the website.config file from the vanilla upgrade back into the source package. Transforms of course, remove this dependency.
I’ve actually solved the problem by doing a transform as an additional OD step via powershell :slight_smile:

Code as attached for your reference.
(Its a bit messy as I’m still playing around with it)

#Apply config transformation
function applyConfigTransformation($src,$xdt,$dst)
{
Add-Type -Path “C:\Program Files (x86)\MSBuild\Microsoft\Transforms\Microsoft.Web.XmlTransform.dll”
try
{
Write-Host ‘applyConfigTransformation - Called’
Write-Host $src

    $doc1 = New-Object Microsoft.Web.XmlTransform.XmlTransformableDocument
    $doc1.PreserveWhiteSpace = $true
    Write-Host 'Test - Load Called'
    $doc1.Load("D:\Sitecore\VRL8\DEV\Web.config")
    Write-Host 'Test - Load OK'



    $doc = New-Object Microsoft.Web.XmlTransform.XmlTransformableDocument
    $doc.PreserveWhiteSpace = $true
    Write-Host 'applyConfigTransformation - Load Called'
    $doc.Load($src)
    Write-Host 'applyConfigTransformation - Load completed'

    $trn = New-Object Microsoft.Web.XmlTransform.XmlTransformation($xdt)

    if ($trn.Apply($doc))
    {
        $doc.Save($dst)
        Write-Output "Output file: $dst : transforms applied"
    }
    else
    {
        throw "Transformation terminated with status False"
    }
}
catch
{
    Write-Output $Error[0].Exception
    throw "Transformation terminated with status False"
} 

}

$src = “D:\Sitecore\VRL8\DEV\0.0.91.2\website\Web.config”
$xdt = “#{installationRoot}website\Web.Release.config”
$dst = “#{installationRoot}website\web.config”
applyConfigTransformation $src $xdt $dst

Cheers
Bill

Hi Bill,

Thanks for following up and taking the time to provide your solution! That’s great to hear that you got this up and running, and I’m sure this will help someone else trying to do the same thing in the future. :slight_smile:

Don’t hesitate to reach out if you have any further questions in the future.

Kind regards,

Kenny

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