container-deployment icon indicating copy to clipboard operation
container-deployment copied to clipboard

Add More Customization Parameters to ComposeInit.ps1

Open ddelella opened this issue 2 years ago • 0 comments

I am frustrated that I cannot configure the container project to the same level as my on-premise project. There is far more flexibility is prefix naming conventions.

REQUEST

  1. Add parameter to ComposeInit.ps1 for $SqlDatabasePrefix
  2. Add parameter to ComposeInit.ps1 for $SqlCommerceDatabasePrefix
  3. Add parameter to ComposeInit.ps1 for $SolrCorePrefix
  4. Add parameter to ComposeInit.ps1 for $SolrCommerceCorePrefix

There already exists, in the .env file, options to customize these values. However, they cannot be provided through the parameters sent to the ComposeInit.ps1 script. I had to write a PowerShell script to overwrite these values before running the ComposeInit.ps1. Here is the script I am using:

(Get-Content "C:\Sitecore\xc1-cxa\.env") -replace "SQL_DATABASE_PREFIX=Sitecore","SQL_DATABASE_PREFIX=rrx" |  Out-File "C:\Sitecore\xc1-cxa\.env"
(Get-Content "C:\Sitecore\xc1-cxa\.env") -replace "SOLR_CORE_PREFIX_NAME=sitecore","SOLR_CORE_PREFIX_NAME=rrx" |  Out-File "C:\Sitecore\xc1-cxa\.env"
(Get-Content "C:\Sitecore\xc1-cxa\.env") -replace "SOLR_COMMERCE_PREFIX_NAME=commerce","SOLR_COMMERCE_PREFIX_NAME=rrx" |  Out-File "C:\Sitecore\xc1-cxa\.env"

The commerce database prefix is the big problem. I searched and replaced all instances of SitecoreCommerce_ with xxx.SitecoreCommerce_ to force the 3 commerce databases to have a prefix. It did not work. No matter what I do to the configuration files it always attaches with the standard naming. I believe there is something in the docker image which is hard coded. Notice the screenshot, no prefixes.

image

ddelella avatar Aug 12 '23 17:08 ddelella