From d0081e5576526e6fe5b88634ecf100052b8594e1 Mon Sep 17 00:00:00 2001 From: "miguel.minoldo" Date: Sun, 13 Mar 2022 15:48:11 +0100 Subject: [PATCH 1/2] Upgrade helix-basic-unicorn to Sitecore 10.2 Upgraded SITECORE_VERSION to 10.2-ltsc9 Upgraded Unicorn to 4.1.6 Upgraded Moq to 4.17.2 Upgraded xunit.runner.visualstudio to 2.4.3 Upgraded solr to 8.8.2 Replaced sitecore-id for sitecore-id6 Adapted health check to versions changes --- examples/helix-basic-unicorn/.env | 6 +++--- examples/helix-basic-unicorn/Packages.props | 13 ++++++------- .../helix-basic-unicorn/docker-compose.override.yml | 8 ++++---- examples/helix-basic-unicorn/docker-compose.yml | 11 ++++++----- .../BasicCompany.Feature.Navigation.Tests.csproj | 1 - .../BasicCompany.Feature.Products.Tests.csproj | 1 - ...10.1.config => Unicorn.DataProvider.10.2.config} | 0 .../BasicCompany.Foundation.Serialization.csproj | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) rename examples/helix-basic-unicorn/src/Foundation/Serialization/website/App_Config/Include/Unicorn/{Unicorn.DataProvider.10.1.config => Unicorn.DataProvider.10.2.config} (100%) diff --git a/examples/helix-basic-unicorn/.env b/examples/helix-basic-unicorn/.env index 713cb657..fb5df9f7 100644 --- a/examples/helix-basic-unicorn/.env +++ b/examples/helix-basic-unicorn/.env @@ -20,8 +20,8 @@ SITE_HOST=www.basic-company-unicorn.localhost SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/ -SITECORE_VERSION=10.1-ltsc2019 -TOOLS_VERSION=10.1-1809 +SITECORE_VERSION=10.2-ltsc2019 +TOOLS_VERSION=10.2-1809 SITECORE_ADMIN_PASSWORD= SQL_SA_PASSWORD= @@ -36,4 +36,4 @@ SITECORE_LICENSE= TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809 TRAEFIK_ISOLATION=hyperv ISOLATION=default -MEDIA_REQUEST_PROTECTION_SHARED_SECRET= \ No newline at end of file +MEDIA_REQUEST_PROTECTION_SHARED_SECRET= diff --git a/examples/helix-basic-unicorn/Packages.props b/examples/helix-basic-unicorn/Packages.props index 3b62fc67..dd36d5a3 100644 --- a/examples/helix-basic-unicorn/Packages.props +++ b/examples/helix-basic-unicorn/Packages.props @@ -1,10 +1,9 @@ - 10.1.0 + 10.2.0 - @@ -12,15 +11,15 @@ - - - + + + - + - + \ No newline at end of file diff --git a/examples/helix-basic-unicorn/docker-compose.override.yml b/examples/helix-basic-unicorn/docker-compose.override.yml index fb7b9393..1557338c 100644 --- a/examples/helix-basic-unicorn/docker-compose.override.yml +++ b/examples/helix-basic-unicorn/docker-compose.override.yml @@ -24,11 +24,11 @@ services: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} mssql: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-mssql:${VERSION:-latest} + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}nonproduction/mssql-developer:2017-${SITECORE_VERSION} build: context: ./docker/build/mssql args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION} + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${SITECORE_VERSION} mem_limit: 2GB volumes: - ${LOCAL_DATA_PATH}\mssql:c:\data @@ -46,11 +46,11 @@ services: mem_limit: 1GB id: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest} + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id6:${VERSION:-latest} build: context: ./docker/build/id args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION} + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} volumes: - ${HOST_LICENSE_FOLDER}:C:\license environment: diff --git a/examples/helix-basic-unicorn/docker-compose.yml b/examples/helix-basic-unicorn/docker-compose.yml index 9ae077a8..a15fd506 100644 --- a/examples/helix-basic-unicorn/docker-compose.yml +++ b/examples/helix-basic-unicorn/docker-compose.yml @@ -29,10 +29,9 @@ services: condition: service_healthy redis: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} mssql: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${SITECORE_VERSION} environment: SA_PASSWORD: ${SQL_SA_PASSWORD} SITECORE_ADMIN_PASSWORD: ${SITECORE_ADMIN_PASSWORD} @@ -45,15 +44,17 @@ services: target: c:\data solr: isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.8.2-${SITECORE_VERSION} ports: - "8984:8983" - image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.4.0-${SITECORE_VERSION} volumes: - type: bind source: .\solr-data target: c:\data 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 }"] solr-init: isolation: ${ISOLATION} image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION} @@ -65,7 +66,7 @@ services: condition: service_healthy id: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} environment: Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=mssql;Initial Catalog=Sitecore.Core;User ID=sa;Password=${SQL_SA_PASSWORD} Sitecore_Sitecore__IdentityServer__AccountOptions__PasswordRecoveryUrl: https://${CM_HOST}/sitecore/login?rc=1 @@ -76,7 +77,7 @@ services: Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword: ${SITECORE_ID_CERTIFICATE_PASSWORD} Sitecore_License: ${SITECORE_LICENSE} healthcheck: - test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] timeout: 300s depends_on: mssql: diff --git a/examples/helix-basic-unicorn/src/Feature/Navigation/tests/BasicCompany.Feature.Navigation.Tests.csproj b/examples/helix-basic-unicorn/src/Feature/Navigation/tests/BasicCompany.Feature.Navigation.Tests.csproj index 42e40f6d..40a5967f 100644 --- a/examples/helix-basic-unicorn/src/Feature/Navigation/tests/BasicCompany.Feature.Navigation.Tests.csproj +++ b/examples/helix-basic-unicorn/src/Feature/Navigation/tests/BasicCompany.Feature.Navigation.Tests.csproj @@ -53,7 +53,6 @@ - runtime; build; native; contentfiles; analyzers diff --git a/examples/helix-basic-unicorn/src/Feature/Products/tests/BasicCompany.Feature.Products.Tests.csproj b/examples/helix-basic-unicorn/src/Feature/Products/tests/BasicCompany.Feature.Products.Tests.csproj index 3d238e45..d17fd011 100644 --- a/examples/helix-basic-unicorn/src/Feature/Products/tests/BasicCompany.Feature.Products.Tests.csproj +++ b/examples/helix-basic-unicorn/src/Feature/Products/tests/BasicCompany.Feature.Products.Tests.csproj @@ -52,7 +52,6 @@ - runtime; build; native; contentfiles; analyzers diff --git a/examples/helix-basic-unicorn/src/Foundation/Serialization/website/App_Config/Include/Unicorn/Unicorn.DataProvider.10.1.config b/examples/helix-basic-unicorn/src/Foundation/Serialization/website/App_Config/Include/Unicorn/Unicorn.DataProvider.10.2.config similarity index 100% rename from examples/helix-basic-unicorn/src/Foundation/Serialization/website/App_Config/Include/Unicorn/Unicorn.DataProvider.10.1.config rename to examples/helix-basic-unicorn/src/Foundation/Serialization/website/App_Config/Include/Unicorn/Unicorn.DataProvider.10.2.config diff --git a/examples/helix-basic-unicorn/src/Foundation/Serialization/website/BasicCompany.Foundation.Serialization.csproj b/examples/helix-basic-unicorn/src/Foundation/Serialization/website/BasicCompany.Foundation.Serialization.csproj index aa73d47f..fce1eb1c 100644 --- a/examples/helix-basic-unicorn/src/Foundation/Serialization/website/BasicCompany.Foundation.Serialization.csproj +++ b/examples/helix-basic-unicorn/src/Foundation/Serialization/website/BasicCompany.Foundation.Serialization.csproj @@ -95,8 +95,8 @@ - + From 8fdd5c02794b41cf0d037b0973b10183cd075b99 Mon Sep 17 00:00:00 2001 From: "miguel.minoldo" Date: Mon, 14 Mar 2022 07:47:27 +0100 Subject: [PATCH 2/2] Added mssql-init --- .../docker-compose.override.yml | 12 +++++------ .../helix-basic-unicorn/docker-compose.yml | 20 ++++++++++++++++++- .../docker/build/mssql-init/Dockerfile | 5 +++++ 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 examples/helix-basic-unicorn/docker/build/mssql-init/Dockerfile diff --git a/examples/helix-basic-unicorn/docker-compose.override.yml b/examples/helix-basic-unicorn/docker-compose.override.yml index 1557338c..0f16e5ce 100644 --- a/examples/helix-basic-unicorn/docker-compose.override.yml +++ b/examples/helix-basic-unicorn/docker-compose.override.yml @@ -24,15 +24,15 @@ services: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} mssql: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}nonproduction/mssql-developer:2017-${SITECORE_VERSION} - build: - context: ./docker/build/mssql - args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${SITECORE_VERSION} - mem_limit: 2GB volumes: - ${LOCAL_DATA_PATH}\mssql:c:\data + mssql-init: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-mssql-init:${VERSION:-latest} + build: + context: ./docker/build/mssql-init + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql-init:${SITECORE_VERSION} solr: volumes: - ${LOCAL_DATA_PATH}\solr:c:\data diff --git a/examples/helix-basic-unicorn/docker-compose.yml b/examples/helix-basic-unicorn/docker-compose.yml index a15fd506..db579c7a 100644 --- a/examples/helix-basic-unicorn/docker-compose.yml +++ b/examples/helix-basic-unicorn/docker-compose.yml @@ -42,6 +42,24 @@ services: - type: bind source: .\mssql-data target: c:\data + + mssql-init: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql-init:${SITECORE_VERSION} + environment: + SQL_SERVER: mssql + SQL_ADMIN_LOGIN: sa + SQL_ADMIN_PASSWORD: ${SQL_SA_PASSWORD} + SITECORE_ADMIN_PASSWORD: ${SITECORE_ADMIN_PASSWORD} + POST_DEPLOYMENT_WAIT_PERIOD: 300 + healthcheck: + test: ["CMD", "powershell", "-command", "if ([System.Environment]::GetEnvironmentVariable('DatabasesDeploymentStatus', 'Machine') -eq 'Complete') { exit 0 } else { exit 1}"] + start_period: 300s + interval: 5s + depends_on: + mssql: + condition: service_healthy + solr: isolation: ${ISOLATION} image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.8.2-${SITECORE_VERSION} @@ -80,7 +98,7 @@ services: test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] timeout: 300s depends_on: - mssql: + mssql-init: condition: service_healthy labels: - "traefik.enable=true" diff --git a/examples/helix-basic-unicorn/docker/build/mssql-init/Dockerfile b/examples/helix-basic-unicorn/docker/build/mssql-init/Dockerfile new file mode 100644 index 00000000..86bba36d --- /dev/null +++ b/examples/helix-basic-unicorn/docker/build/mssql-init/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG BASE_IMAGE + +FROM ${BASE_IMAGE} \ No newline at end of file