Skip to content

Commit

Permalink
Merge pull request #161 from Sitecore/sxp/10.3.2.010837.1896)
Browse files Browse the repository at this point in the history
Update Sitecore Experience Platform Container Deployment to 10.3.2.010837.1896
  • Loading branch information
sc-eugeniabelinskaya authored Aug 16, 2024
2 parents ac0baca + 2281e89 commit 72ba649
Show file tree
Hide file tree
Showing 46 changed files with 409 additions and 531 deletions.
76 changes: 31 additions & 45 deletions compose/sxp/10.3/ltsc2019/upgrade/xm1/compose-init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Param (
$IdHost = "$($Topology)id.localhost",

[string]
$SitecoreGalleryRepositoryLocation = "https://sitecore.myget.org/F/sc-powershell/api/v2",
$SitecoreGalleryRepositoryLocation = "https://nuget.sitecore.com/resources/v2/",

[string]
$CertDataFolder = ".\traefik\certs",
Expand Down Expand Up @@ -185,17 +185,36 @@ function Update-CertsConfigFile{
Write-Information -MessageData "certs_config.yaml file was successfully updated." -InformationAction Continue
}

function InstallModule{
param(
[string]$ModuleName,
[string]$ModuleVersion,
[string]$RepositoryName
function InstallModule {
Param(
[String]$ModuleName,
[String]$ModuleVersion
)
try {
$repository = Get-PSRepository | Where-Object { $_.SourceLocation -eq $SitecoreGalleryRepositoryLocation }
if (!$repository) {
$tempRepositoryName = "Temp" + (New-Guid)
Register-PSRepository -Name $tempRepositoryName -SourceLocation $SitecoreGalleryRepositoryLocation -InstallationPolicy Trusted
$repository = Get-PSRepository | Where-Object { $_.SourceLocation -eq $SitecoreGalleryRepositoryLocation }
}
if (!$ModuleVersion) {
$ModuleVersion = (Find-Module -Name $ModuleName -Repository $repository.Name -AllowPrerelease).Version
Write-Host "The Docker tool version was not specified. The latest available '$ModuleVersion' version will be used." -ForegroundColor Green
}

$moduleInstalled = Get-InstalledModule -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -ErrorAction SilentlyContinue
if (-not $moduleInstalled) {
Write-Host "Installing '$ModuleName'" -ForegroundColor Green
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -Repository $RepositoryName -Scope CurrentUser
$moduleInstalled = Get-InstalledModule -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -ErrorAction SilentlyContinue
if (!$moduleInstalled) {
Write-Host "Installing '$ModuleName' $ModuleVersion" -ForegroundColor Green
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -Repository $repository.Name -AllowClobber -AllowPrerelease -Scope CurrentUser -Force -ErrorAction "Stop"
}
$localModulePath = ((Get-Module $ModuleName -ListAvailable) | Where-Object Version -eq $ModuleVersion.Split("-")[0]).Path
Write-Host "Importing '$moduleName' '$ModuleVersion' from '$localModulePath' ..."
Import-Module -Name $localModulePath
}
finally {
if ($tempRepositoryName -and ($repository.Name -eq $tempRepositoryName)) {
Unregister-PSRepository -Name $tempRepositoryName
}
}
}

Expand All @@ -207,42 +226,9 @@ function Invoke-ComposeInit {
throw "$LicenseXmlPath is not a file"
}

# Check for Sitecore Gallery
Import-Module PowerShellGet
$SitecoreGalleryName = 'SitecoreGallery'
$SitecoreGallery = Get-PSRepository | Where-Object { $_.Name -eq $SitecoreGalleryName }
if (-not $SitecoreGallery) {
Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green
Register-PSRepository -Name $SitecoreGalleryName -SourceLocation $SitecoreGalleryRepositoryLocation -InstallationPolicy Trusted
$SitecoreGallery = Get-PSRepository -Name $SitecoreGalleryName
}

# Install and Import SitecoreDockerTools
$moduleName = "SitecoreDockerTools"
$repositoryName = $SitecoreGallery.Name

$module = Find-Module -Name $moduleName -Repository $repositoryName
$latestVersion = $module.Version
$importModuleCommand = "Import-Module $moduleName -RequiredVersion $latestVersion"

if(![string]::IsNullOrEmpty($SpecificVersion)){
$module = Find-Module -Name $moduleName -Repository $repositoryName -RequiredVersion $SpecificVersion -AllowPrerelease
$latestVersion = $module.Version

if([string]::IsNullOrEmpty($latestVersion)){
Write-Warning -Message "'$moduleName' module with '$SpecificVersion' version doesn't exist."
return
}
InstallModule -ModuleName $moduleName -ModuleVersion $latestVersion -RepositoryName $repositoryName

$modulePath = ((Get-Module $moduleName -ListAvailable) | where Version -eq $latestVersion.Split("-")[0]).Path
$importModuleCommand = "Import-Module -Name $modulePath"
}else{
InstallModule -ModuleName $moduleName -ModuleVersion $latestVersion -RepositoryName $repositoryName
}

Write-Host "Importing '$moduleName'..." -ForegroundColor Green
Invoke-Expression $importModuleCommand
$ModuleName = "SitecoreDockerTools"
InstallModule -ModuleName $ModuleName -ModuleVersion $SpecificVersion

$idCertPassword = Get-SitecoreRandomString 12 -DisallowSpecial
$envVariablesTable = @{
Expand Down
2 changes: 1 addition & 1 deletion compose/sxp/10.3/ltsc2019/upgrade/xm1/upgrade.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ SQL_SERVER=
SQL_USERNAME=
SQL_PASSWORD=
DATABASE_UPGRADE_FROM_VERSION=10.2.0
DATABASE_UPGRADE_TO_VERSION=10.3.1
DATABASE_UPGRADE_TO_VERSION=10.3.2
SITECORE_LICENSE=
ISOLATION=default
76 changes: 31 additions & 45 deletions compose/sxp/10.3/ltsc2019/upgrade/xp1/compose-init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Param (
$IdHost = "$($Topology)id.localhost",

[string]
$SitecoreGalleryRepositoryLocation = "https://sitecore.myget.org/F/sc-powershell/api/v2",
$SitecoreGalleryRepositoryLocation = "https://nuget.sitecore.com/resources/v2/",

[string]
$CertDataFolder = ".\traefik\certs",
Expand Down Expand Up @@ -185,17 +185,36 @@ function Update-CertsConfigFile{
Write-Information -MessageData "certs_config.yaml file was successfully updated." -InformationAction Continue
}

function InstallModule{
param(
[string]$ModuleName,
[string]$ModuleVersion,
[string]$RepositoryName
function InstallModule {
Param(
[String]$ModuleName,
[String]$ModuleVersion
)
try {
$repository = Get-PSRepository | Where-Object { $_.SourceLocation -eq $SitecoreGalleryRepositoryLocation }
if (!$repository) {
$tempRepositoryName = "Temp" + (New-Guid)
Register-PSRepository -Name $tempRepositoryName -SourceLocation $SitecoreGalleryRepositoryLocation -InstallationPolicy Trusted
$repository = Get-PSRepository | Where-Object { $_.SourceLocation -eq $SitecoreGalleryRepositoryLocation }
}
if (!$ModuleVersion) {
$ModuleVersion = (Find-Module -Name $ModuleName -Repository $repository.Name -AllowPrerelease).Version
Write-Host "The Docker tool version was not specified. The latest available '$ModuleVersion' version will be used." -ForegroundColor Green
}

$moduleInstalled = Get-InstalledModule -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -ErrorAction SilentlyContinue
if (-not $moduleInstalled) {
Write-Host "Installing '$ModuleName'" -ForegroundColor Green
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -Repository $RepositoryName -Scope CurrentUser
$moduleInstalled = Get-InstalledModule -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -ErrorAction SilentlyContinue
if (!$moduleInstalled) {
Write-Host "Installing '$ModuleName' $ModuleVersion" -ForegroundColor Green
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -Repository $repository.Name -AllowClobber -AllowPrerelease -Scope CurrentUser -Force -ErrorAction "Stop"
}
$localModulePath = ((Get-Module $ModuleName -ListAvailable) | Where-Object Version -eq $ModuleVersion.Split("-")[0]).Path
Write-Host "Importing '$moduleName' '$ModuleVersion' from '$localModulePath' ..."
Import-Module -Name $localModulePath
}
finally {
if ($tempRepositoryName -and ($repository.Name -eq $tempRepositoryName)) {
Unregister-PSRepository -Name $tempRepositoryName
}
}
}

Expand All @@ -207,42 +226,9 @@ function Invoke-ComposeInit {
throw "$LicenseXmlPath is not a file"
}

# Check for Sitecore Gallery
Import-Module PowerShellGet
$SitecoreGalleryName = 'SitecoreGallery'
$SitecoreGallery = Get-PSRepository | Where-Object { $_.Name -eq $SitecoreGalleryName }
if (-not $SitecoreGallery) {
Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green
Register-PSRepository -Name $SitecoreGalleryName -SourceLocation $SitecoreGalleryRepositoryLocation -InstallationPolicy Trusted
$SitecoreGallery = Get-PSRepository -Name $SitecoreGalleryName
}

# Install and Import SitecoreDockerTools
$moduleName = "SitecoreDockerTools"
$repositoryName = $SitecoreGallery.Name

$module = Find-Module -Name $moduleName -Repository $repositoryName
$latestVersion = $module.Version
$importModuleCommand = "Import-Module $moduleName -RequiredVersion $latestVersion"

if(![string]::IsNullOrEmpty($SpecificVersion)){
$module = Find-Module -Name $moduleName -Repository $repositoryName -RequiredVersion $SpecificVersion -AllowPrerelease
$latestVersion = $module.Version

if([string]::IsNullOrEmpty($latestVersion)){
Write-Warning -Message "'$moduleName' module with '$SpecificVersion' version doesn't exist."
return
}
InstallModule -ModuleName $moduleName -ModuleVersion $latestVersion -RepositoryName $repositoryName

$modulePath = ((Get-Module $moduleName -ListAvailable) | where Version -eq $latestVersion.Split("-")[0]).Path
$importModuleCommand = "Import-Module -Name $modulePath"
}else{
InstallModule -ModuleName $moduleName -ModuleVersion $latestVersion -RepositoryName $repositoryName
}

Write-Host "Importing '$moduleName'..." -ForegroundColor Green
Invoke-Expression $importModuleCommand
$ModuleName = "SitecoreDockerTools"
InstallModule -ModuleName $ModuleName -ModuleVersion $SpecificVersion

$idCertPassword = Get-SitecoreRandomString 12 -DisallowSpecial
$envVariablesTable = @{
Expand Down
2 changes: 1 addition & 1 deletion compose/sxp/10.3/ltsc2019/upgrade/xp1/upgrade.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ SQL_PASSWORD=
IS_ALWAYS_ENCRYPTED=
PROCESSING_ENGINE_TASKS_DATABASE_USERNAME=
DATABASE_UPGRADE_FROM_VERSION=10.2.0
DATABASE_UPGRADE_TO_VERSION=10.3.1
DATABASE_UPGRADE_TO_VERSION=10.3.2
SITECORE_LICENSE=
ISOLATION=default
4 changes: 2 additions & 2 deletions compose/sxp/10.3/ltsc2019/xm1/.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ SITECORE_LICENSE=
CD_HOST=xm1cd.localhost
CM_HOST=xm1cm.localhost
ID_HOST=xm1id.localhost
TRAEFIK_IMAGE=traefik:v2.9.8-windowsservercore-1809
TRAEFIK_ISOLATION=hyperv
TRAEFIK_IMAGE=traefik:v2.11.0-windowsservercore-1809
TRAEFIK_ISOLATION=default
ISOLATION=default
SOLR_CORE_PREFIX_NAME=sitecore
# You should change the shared secret to a random string and not use the default value
Expand Down
76 changes: 31 additions & 45 deletions compose/sxp/10.3/ltsc2019/xm1/compose-init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Param (
$IdHost = "$($Topology)id.localhost",

[string]
$SitecoreGalleryRepositoryLocation = "https://sitecore.myget.org/F/sc-powershell/api/v2",
$SitecoreGalleryRepositoryLocation = "https://nuget.sitecore.com/resources/v2/",

[string]
$CertDataFolder = ".\traefik\certs",
Expand Down Expand Up @@ -185,17 +185,36 @@ function Update-CertsConfigFile{
Write-Information -MessageData "certs_config.yaml file was successfully updated." -InformationAction Continue
}

function InstallModule{
param(
[string]$ModuleName,
[string]$ModuleVersion,
[string]$RepositoryName
function InstallModule {
Param(
[String]$ModuleName,
[String]$ModuleVersion
)
try {
$repository = Get-PSRepository | Where-Object { $_.SourceLocation -eq $SitecoreGalleryRepositoryLocation }
if (!$repository) {
$tempRepositoryName = "Temp" + (New-Guid)
Register-PSRepository -Name $tempRepositoryName -SourceLocation $SitecoreGalleryRepositoryLocation -InstallationPolicy Trusted
$repository = Get-PSRepository | Where-Object { $_.SourceLocation -eq $SitecoreGalleryRepositoryLocation }
}
if (!$ModuleVersion) {
$ModuleVersion = (Find-Module -Name $ModuleName -Repository $repository.Name -AllowPrerelease).Version
Write-Host "The Docker tool version was not specified. The latest available '$ModuleVersion' version will be used." -ForegroundColor Green
}

$moduleInstalled = Get-InstalledModule -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -ErrorAction SilentlyContinue
if (-not $moduleInstalled) {
Write-Host "Installing '$ModuleName'" -ForegroundColor Green
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -Repository $RepositoryName -Scope CurrentUser
$moduleInstalled = Get-InstalledModule -Name $ModuleName -RequiredVersion $ModuleVersion -AllowPrerelease -ErrorAction SilentlyContinue
if (!$moduleInstalled) {
Write-Host "Installing '$ModuleName' $ModuleVersion" -ForegroundColor Green
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -Repository $repository.Name -AllowClobber -AllowPrerelease -Scope CurrentUser -Force -ErrorAction "Stop"
}
$localModulePath = ((Get-Module $ModuleName -ListAvailable) | Where-Object Version -eq $ModuleVersion.Split("-")[0]).Path
Write-Host "Importing '$moduleName' '$ModuleVersion' from '$localModulePath' ..."
Import-Module -Name $localModulePath
}
finally {
if ($tempRepositoryName -and ($repository.Name -eq $tempRepositoryName)) {
Unregister-PSRepository -Name $tempRepositoryName
}
}
}

Expand All @@ -207,42 +226,9 @@ function Invoke-ComposeInit {
throw "$LicenseXmlPath is not a file"
}

# Check for Sitecore Gallery
Import-Module PowerShellGet
$SitecoreGalleryName = 'SitecoreGallery'
$SitecoreGallery = Get-PSRepository | Where-Object { $_.Name -eq $SitecoreGalleryName }
if (-not $SitecoreGallery) {
Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green
Register-PSRepository -Name $SitecoreGalleryName -SourceLocation $SitecoreGalleryRepositoryLocation -InstallationPolicy Trusted
$SitecoreGallery = Get-PSRepository -Name $SitecoreGalleryName
}

# Install and Import SitecoreDockerTools
$moduleName = "SitecoreDockerTools"
$repositoryName = $SitecoreGallery.Name

$module = Find-Module -Name $moduleName -Repository $repositoryName
$latestVersion = $module.Version
$importModuleCommand = "Import-Module $moduleName -RequiredVersion $latestVersion"

if(![string]::IsNullOrEmpty($SpecificVersion)){
$module = Find-Module -Name $moduleName -Repository $repositoryName -RequiredVersion $SpecificVersion -AllowPrerelease
$latestVersion = $module.Version

if([string]::IsNullOrEmpty($latestVersion)){
Write-Warning -Message "'$moduleName' module with '$SpecificVersion' version doesn't exist."
return
}
InstallModule -ModuleName $moduleName -ModuleVersion $latestVersion -RepositoryName $repositoryName

$modulePath = ((Get-Module $moduleName -ListAvailable) | where Version -eq $latestVersion.Split("-")[0]).Path
$importModuleCommand = "Import-Module -Name $modulePath"
}else{
InstallModule -ModuleName $moduleName -ModuleVersion $latestVersion -RepositoryName $repositoryName
}

Write-Host "Importing '$moduleName'..." -ForegroundColor Green
Invoke-Expression $importModuleCommand
$ModuleName = "SitecoreDockerTools"
InstallModule -ModuleName $ModuleName -ModuleVersion $SpecificVersion

$idCertPassword = Get-SitecoreRandomString 12 -DisallowSpecial
$envVariablesTable = @{
Expand Down
4 changes: 2 additions & 2 deletions compose/sxp/10.3/ltsc2019/xm1/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
image: ${SITECORE_DOCKER_REGISTRY}redis:3.2.100-${EXTERNAL_IMAGE_TAG_SUFFIX}
mssql:
isolation: ${ISOLATION}
image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${EXTERNAL_IMAGE_TAG_SUFFIX}
image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2019-${EXTERNAL_IMAGE_TAG_SUFFIX}
environment:
SA_PASSWORD: ${SQL_SA_PASSWORD}
ACCEPT_EULA: "Y"
Expand Down Expand Up @@ -72,7 +72,7 @@ services:
environment:
SOLR_MODE: solrcloud
healthcheck:
test: ["CMD", "powershell", "-command", "try { $$statusCode = (iwr http://solr:8983/solr/admin/cores?action=STATUS -UseBasicParsing).StatusCode; if ($$statusCode -eq 200) { exit 0 } else { exit 1} } catch { exit 1 }"]
test: ["CMD", "powershell", "-command", "try { $$statusCode = (iwr http://solr:8983/solr/admin/collections?action=LIST -UseBasicParsing).StatusCode; if ($$statusCode -eq 200) { exit 0 } else { exit 1} } catch { exit 1 }"]
solr-init:
isolation: ${ISOLATION}
image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION}
Expand Down
4 changes: 2 additions & 2 deletions compose/sxp/10.3/ltsc2019/xp0/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ SITECORE_ID_CERTIFICATE_PASSWORD=
SITECORE_LICENSE=
CM_HOST=xp0cm.localhost
ID_HOST=xp0id.localhost
TRAEFIK_IMAGE=traefik:v2.9.8-windowsservercore-1809
TRAEFIK_ISOLATION=hyperv
TRAEFIK_IMAGE=traefik:v2.11.0-windowsservercore-1809
TRAEFIK_ISOLATION=default
ISOLATION=default
SOLR_CORE_PREFIX_NAME=sitecore
# You should change the shared secret to a random string and not use the default value
Expand Down
Loading

0 comments on commit 72ba649

Please sign in to comment.