From 9809b432c80869988ad26ece0e57fd128ff06324 Mon Sep 17 00:00:00 2001 From: dsolovay Date: Mon, 29 Apr 2024 21:07:56 -0400 Subject: [PATCH] Add ability to run side-by-side Sitecore XP0s Helpful for when new versions are released. Implements #68. --- README.md | 1 + sitecore-compare/.env | 42 ++ sitecore-compare/.gitignore | 13 + sitecore-compare/clean.ps1 | 5 + sitecore-compare/docker-compose.yml | 479 ++++++++++++++++++ sitecore-compare/init.ps1 | 152 ++++++ sitecore-compare/mssql-data/.gitkeep | 0 sitecore-compare/solr-data/.gitkeep | 0 sitecore-compare/traefik/certs/.gitkeep | 0 .../traefik/config/dynamic/certs_config.yaml | 10 + 10 files changed, 702 insertions(+) create mode 100644 sitecore-compare/.env create mode 100644 sitecore-compare/.gitignore create mode 100644 sitecore-compare/clean.ps1 create mode 100644 sitecore-compare/docker-compose.yml create mode 100644 sitecore-compare/init.ps1 create mode 100644 sitecore-compare/mssql-data/.gitkeep create mode 100644 sitecore-compare/solr-data/.gitkeep create mode 100644 sitecore-compare/traefik/certs/.gitkeep create mode 100644 sitecore-compare/traefik/config/dynamic/certs_config.yaml diff --git a/README.md b/README.md index 91b04b5..9f7b4e1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Briefly, here's what you'll find in this repo: * Example for running an out of the box Sitecore instance (see `getting-started`). * Example solution for creating custom Sitecore images, with recommended folder structure for container development (see `custom-images`). * Sample PowerShell scripts for container-based Sitecore instance preparation (`init.ps1`) and cleanup (`clean.ps1`). +* Docker compose file for running side-by-site XP0 instances with different versions of Sitecore (see `sitecore-compare`). * Docker compose files for building Sitecore instances in various topologies (see `custom-images`). Please refer to the [Sitecore Containers documentation](https://doc.sitecore.com/xp/en/developers/latest/developer-tools/containers-in-sitecore-development.html) for complete details, including running the examples and recommended usage. diff --git a/sitecore-compare/.env b/sitecore-compare/.env new file mode 100644 index 0000000..4b54e14 --- /dev/null +++ b/sitecore-compare/.env @@ -0,0 +1,42 @@ +COMPOSE_PROJECT_NAME=sitecore-compare +SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ +SITECORE_VERSION_1=10.3.1-ltsc2022 +SITECORE_VERSION_2=10.4.0-ltsc2022 +SITECORE_ADMIN_PASSWORD=Password12345 +SQL_SA_PASSWORD=Password12345 +TELERIK_ENCRYPTION_KEY= +SITECORE_IDSECRET= +SITECORE_ID_CERTIFICATE= +SITECORE_ID_CERTIFICATE_PASSWORD= +SITECORE_LICENSE= +CM_HOST_1=xp103cm.localhost +CM_HOST_2=xp104cm.localhost +ID_HOST_1=xp103id.localhost +ID_HOST_2=xp104id.localhost +TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809 +TRAEFIK_ISOLATION=hyperv +ISOLATION=default +SOLR_CORE_PREFIX_NAME_1=Sitecore103 +SOLR_CORE_PREFIX_NAME_2=Sitecore104 +# You should change the shared secret to a random string and not use the default value +MEDIA_REQUEST_PROTECTION_SHARED_SECRET= + +SOLR_PORT=8984 +HTTPS_PORT=443 +TRAEFIK_MANAGEMENT_PORT=8079 +MSSQL_PORT=14330 +XCONNECT_PORT_1=8081 +XCONNECT_PORT_2=8082 + +SQL_SERVER=mssql +SQL_SA_LOGIN=sa +SQL_CUSTOM_DATABASE_PREFIX_UPDATE_FROM= +SQL_DATABASE_PREFIX_1=Sitecore103 +SQL_DATABASE_PREFIX_2=Sitecore104 + +SITECORE_GRAPHQL_UPLOADMEDIAOPTIONS_ENCRYPTIONKEY= +SITECORE_GRAPHQL_ENABLED=true +SITECORE_GRAPHQL_EXPOSEPLAYGROUND=true + +LOG_LEVEL_VALUE=INFO +EXTERNAL_IMAGE_TAG_SUFFIX=ltsc2022 \ No newline at end of file diff --git a/sitecore-compare/.gitignore b/sitecore-compare/.gitignore new file mode 100644 index 0000000..7fc686f --- /dev/null +++ b/sitecore-compare/.gitignore @@ -0,0 +1,13 @@ +/mssql-data/* +!/mssql-data/.gitkeep +/solr-data/* +!/solr-data/.gitkeep + +/traefik/certs/* +!/traefik/certs/.gitkeep + +/device-detection-data_1/ +!/device-detection-data_1/.gitkeep + +/device-detection-data_2/ +!/device-detection-data_2/.gitkeep \ No newline at end of file diff --git a/sitecore-compare/clean.ps1 b/sitecore-compare/clean.ps1 new file mode 100644 index 0000000..e457a5b --- /dev/null +++ b/sitecore-compare/clean.ps1 @@ -0,0 +1,5 @@ +# Clean data folders +Get-ChildItem -Path (Join-Path $PSScriptRoot "\mssql-data") -Exclude ".gitkeep" -Recurse | Remove-Item -Force -Recurse -Verbose +Get-ChildItem -Path (Join-Path $PSScriptRoot "\solr-data") -Exclude ".gitkeep" -Recurse | Remove-Item -Force -Recurse -Verbose +Get-ChildItem -Path (Join-Path $PSScriptRoot "\device-detection-data_1") -Exclude ".gitkeep" -Recurse | Remove-Item -Force -Recurse -Verbose +Get-ChildItem -Path (Join-Path $PSScriptRoot "\device-detection-data_2") -Exclude ".gitkeep" -Recurse | Remove-Item -Force -Recurse -Verbose \ No newline at end of file diff --git a/sitecore-compare/docker-compose.yml b/sitecore-compare/docker-compose.yml new file mode 100644 index 0000000..ac61dcb --- /dev/null +++ b/sitecore-compare/docker-compose.yml @@ -0,0 +1,479 @@ +services: + traefik: + isolation: ${TRAEFIK_ISOLATION} + image: ${TRAEFIK_IMAGE} + command: + - "--ping" + - "--api.insecure=true" + - "--providers.docker.endpoint=npipe:////./pipe/docker_engine" + - "--providers.docker.exposedByDefault=false" + - "--providers.file.directory=C:/etc/traefik/config/dynamic" + - "--entryPoints.websecure.address=:443" + - "--entryPoints.websecure.forwardedHeaders.insecure" + ports: + - "${HTTPS_PORT}:443" + - "${TRAEFIK_MANAGEMENT_PORT}:8080" + healthcheck: + test: ["CMD", "traefik", "healthcheck", "--ping"] + volumes: + - source: \\.\pipe\docker_engine\ + target: \\.\pipe\docker_engine\ + type: npipe + - ./traefik:C:/etc/traefik + depends_on: + id_1: + condition: service_healthy + cm_1: + condition: service_healthy + id_2: + condition: service_healthy + cm_2: + condition: service_healthy + mssql: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${EXTERNAL_IMAGE_TAG_SUFFIX} + environment: + SA_PASSWORD: ${SQL_SA_PASSWORD} + ACCEPT_EULA: "Y" + ports: + - "${MSSQL_PORT}:1433" + volumes: + - type: bind + source: .\mssql-data + target: c:\data + mssql-init_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql-init:${SITECORE_VERSION_1} + environment: + SQL_SERVER: ${SQL_SERVER} + SQL_ADMIN_LOGIN: ${SQL_SA_LOGIN} + SQL_ADMIN_PASSWORD: ${SQL_SA_PASSWORD} + SQL_DATABASE_PREFIX: ${SQL_DATABASE_PREFIX_1} + SQL_CUSTOM_DATABASE_PREFIX_UPDATE_FROM: ${SQL_CUSTOM_DATABASE_PREFIX_UPDATE_FROM} + 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 + mssql-init_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql-init:${SITECORE_VERSION_2} + environment: + SQL_SERVER: ${SQL_SERVER} + SQL_ADMIN_LOGIN: ${SQL_SA_LOGIN} + SQL_ADMIN_PASSWORD: ${SQL_SA_PASSWORD} + SQL_DATABASE_PREFIX: ${SQL_DATABASE_PREFIX_2} + SQL_CUSTOM_DATABASE_PREFIX_UPDATE_FROM: ${SQL_CUSTOM_DATABASE_PREFIX_UPDATE_FROM} + 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.11.2-${EXTERNAL_IMAGE_TAG_SUFFIX} + ports: + - "${SOLR_PORT}:8983" + volumes: + - type: bind + source: .\solr-data + target: c:\data + environment: + SOLR_MODE: solrcloud + SOLR_JAVA_MEM: "-Xms2g -Xmx2g" + 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_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-solr-init:${SITECORE_VERSION_1} + environment: + SITECORE_SOLR_CONNECTION_STRING: http://solr:8983/solr + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME_1} + depends_on: + solr: + condition: service_healthy + solr-init_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-solr-init:${SITECORE_VERSION_2} + environment: + SITECORE_SOLR_CONNECTION_STRING: http://solr:8983/solr + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME_2} + depends_on: + solr: + condition: service_healthy + id_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-id7:${SITECORE_VERSION_1} + environment: + Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_Sitecore__IdentityServer__AccountOptions__PasswordRecoveryUrl: https://${CM_HOST_1}/sitecore/login?rc=1 + Sitecore_Sitecore__IdentityServer__Clients__PasswordClient__ClientSecrets__ClientSecret1: ${SITECORE_IDSECRET} + Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${CM_HOST_1} + Sitecore_Sitecore__IdentityServer__CertificateRawData: ${SITECORE_ID_CERTIFICATE} + Sitecore_Sitecore__IdentityServer__PublicOrigin: https://${ID_HOST_1} + Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword: ${SITECORE_ID_CERTIFICATE_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + depends_on: + mssql-init_1: + condition: service_healthy + labels: + - "traefik.enable=true" + - "traefik.http.routers.id_1-secure.entrypoints=websecure" + - "traefik.http.routers.id_1-secure.rule=Host(`${ID_HOST_1}`)" + - "traefik.http.routers.id_1-secure.tls=true" + id_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-id7:${SITECORE_VERSION_2} + environment: + Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_Sitecore__IdentityServer__AccountOptions__PasswordRecoveryUrl: https://${CM_HOST_2}/sitecore/login?rc=1 + Sitecore_Sitecore__IdentityServer__Clients__PasswordClient__ClientSecrets__ClientSecret1: ${SITECORE_IDSECRET} + Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${CM_HOST_2} + Sitecore_Sitecore__IdentityServer__CertificateRawData: ${SITECORE_ID_CERTIFICATE} + Sitecore_Sitecore__IdentityServer__PublicOrigin: https://${ID_HOST_2} + Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword: ${SITECORE_ID_CERTIFICATE_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + depends_on: + mssql-init_2: + condition: service_healthy + labels: + - "traefik.enable=true" + - "traefik.http.routers.id_2-secure.entrypoints=websecure" + - "traefik.http.routers.id_2-secure.rule=Host(`${ID_HOST_2}`)" + - "traefik.http.routers.id_2-secure.tls=true" + cm_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cm:${SITECORE_VERSION_1} + depends_on: + id_1: + condition: service_started + xconnect_1: + condition: service_started + environment: + Sitecore_ConnectionStrings_Core: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Master: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Tasks: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Exm.Master: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Exm.master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Sitecore.Reporting.Client: http://xconnect_1 + Sitecore_ConnectionStrings_Cortex.Processing.Engine: http://xconnect_1 + Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true + Sitecore_ConnectionStrings_SitecoreIdentity.Secret: ${SITECORE_IDSECRET} + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect_1 + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Operations.Client: http://xconnect_1 + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Reporting.Client: http://xconnect_1 + Sitecore_ConnectionStrings_Xdb.ReferenceData.Client: http://xconnect_1 + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_GraphQL_Enabled: ${SITECORE_GRAPHQL_ENABLED} + Sitecore_GraphQL_ExposePlayground: ${SITECORE_GRAPHQL_EXPOSEPLAYGROUND} + Sitecore_GraphQL_UploadMediaOptions_EncryptionKey: ${SITECORE_GRAPHQL_UPLOADMEDIAOPTIONS_ENCRYPTIONKEY} + Sitecore_Identity_Server_Authority: https://${ID_HOST_1} + Sitecore_Identity_Server_InternalAuthority: http://id_1 + Sitecore_Identity_Server_CallbackAuthority: https://${CM_HOST_1} + Sitecore_Identity_Server_Require_Https: "false" + Sitecore_Analytics_Forwarded_Request_Http_Header: X-Forwarded-For + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME_1} + MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET} + LOG_LEVEL_VALUE: ${LOG_LEVEL_VALUE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true" + - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000" + - "traefik.http.routers.cm_1-secure.entrypoints=websecure" + - "traefik.http.routers.cm_1-secure.rule=Host(`${CM_HOST_1}`)" + - "traefik.http.routers.cm_1-secure.tls=true" + - "traefik.http.routers.cm_1-secure.middlewares=force-STS-Header" + volumes: + - type: bind + source: .\device-detection-data_1 + target: C:\inetpub\wwwroot\App_Data\DeviceDetection + cm_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cm:${SITECORE_VERSION_2} + depends_on: + id_2: + condition: service_started + xconnect_2: + condition: service_started + environment: + Sitecore_ConnectionStrings_Core: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Master: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Tasks: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Exm.Master: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Exm.master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Sitecore.Reporting.Client: http://xconnect_2 + Sitecore_ConnectionStrings_Cortex.Processing.Engine: http://xconnect_2 + Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true + Sitecore_ConnectionStrings_SitecoreIdentity.Secret: ${SITECORE_IDSECRET} + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect_2 + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Operations.Client: http://xconnect_2 + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Reporting.Client: http://xconnect_2 + Sitecore_ConnectionStrings_Xdb.ReferenceData.Client: http://xconnect_2 + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_GraphQL_Enabled: ${SITECORE_GRAPHQL_ENABLED} + Sitecore_GraphQL_ExposePlayground: ${SITECORE_GRAPHQL_EXPOSEPLAYGROUND} + Sitecore_GraphQL_UploadMediaOptions_EncryptionKey: ${SITECORE_GRAPHQL_UPLOADMEDIAOPTIONS_ENCRYPTIONKEY} + Sitecore_Identity_Server_Authority: https://${ID_HOST_2} + Sitecore_Identity_Server_InternalAuthority: http://id_2 + Sitecore_Identity_Server_CallbackAuthority: https://${CM_HOST_2} + Sitecore_Identity_Server_Require_Https: "false" + Sitecore_Analytics_Forwarded_Request_Http_Header: X-Forwarded-For + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME_2} + MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET} + LOG_LEVEL_VALUE: ${LOG_LEVEL_VALUE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true" + - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000" + - "traefik.http.routers.cm_2-secure.entrypoints=websecure" + - "traefik.http.routers.cm_2-secure.rule=Host(`${CM_HOST_2}`)" + - "traefik.http.routers.cm_2-secure.tls=true" + - "traefik.http.routers.cm_2-secure.middlewares=force-STS-Header" + volumes: + - type: bind + source: .\device-detection-data_2 + target: C:\inetpub\wwwroot\App_Data\DeviceDetection + xconnect_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xconnect:${SITECORE_VERSION_1} + ports: + - "${XCONNECT_PORT_1}:80" + depends_on: + mssql-init_1: + condition: service_healthy + solr-init_1: + condition: service_started + environment: + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME_1}_xdb;solrCloud=true + Sitecore_Sitecore:XConnect:CollectionSearch:Services:Solr.SolrReaderSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: "false" + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbsearchworker_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbsearchworker:${SITECORE_VERSION_1} + depends_on: + xconnect_1: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME_1}_xdb;solrCloud=true + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: "false" + healthcheck: + test: + [ + "CMD", + "powershell", + "-command", + "C:/Healthchecks/Healthcheck.ps1 -Port 8080", + ] + timeout: 300s + xdbautomationworker_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbautomationworker:${SITECORE_VERSION_1} + depends_on: + xconnect_1: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect_1 + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: + [ + "CMD", + "powershell", + "-command", + "C:/Healthchecks/Healthcheck.ps1 -Port 8080", + ] + timeout: 300s + cortexprocessingworker_1: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cortexprocessingworker:${SITECORE_VERSION_1} + depends_on: + xconnect_1: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect_1 + Sitecore_ConnectionStrings_XConnect.Configuration: http://xconnect_1 + Sitecore_ConnectionStrings_XConnect.Search: http://xconnect_1 + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_1}.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: + [ + "CMD", + "powershell", + "-command", + "C:/Healthchecks/Healthcheck.ps1 -Port 8080", + ] + timeout: 300s + xconnect_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xconnect:${SITECORE_VERSION_2} + ports: + - "${XCONNECT_PORT_2}:80" + depends_on: + mssql-init_2: + condition: service_healthy + solr-init_2: + condition: service_started + environment: + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME_2}_xdb;solrCloud=true + Sitecore_Sitecore:XConnect:CollectionSearch:Services:Solr.SolrReaderSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: "false" + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbsearchworker_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbsearchworker:${SITECORE_VERSION_2} + depends_on: + xconnect_2: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME_2}_xdb;solrCloud=true + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: "false" + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: "false" + healthcheck: + test: + [ + "CMD", + "powershell", + "-command", + "C:/Healthchecks/Healthcheck.ps1 -Port 8080", + ] + timeout: 300s + xdbautomationworker_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbautomationworker:${SITECORE_VERSION_2} + depends_on: + xconnect_2: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect_2 + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: + [ + "CMD", + "powershell", + "-command", + "C:/Healthchecks/Healthcheck.ps1 -Port 8080", + ] + timeout: 300s + cortexprocessingworker_2: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cortexprocessingworker:${SITECORE_VERSION_2} + depends_on: + xconnect_2: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect_2 + Sitecore_ConnectionStrings_XConnect.Configuration: http://xconnect_2 + Sitecore_ConnectionStrings_XConnect.Search: http://xconnect_2 + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=${SQL_DATABASE_PREFIX_2}.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: + [ + "CMD", + "powershell", + "-command", + "C:/Healthchecks/Healthcheck.ps1 -Port 8080", + ] + timeout: 300s \ No newline at end of file diff --git a/sitecore-compare/init.ps1 b/sitecore-compare/init.ps1 new file mode 100644 index 0000000..05ab529 --- /dev/null +++ b/sitecore-compare/init.ps1 @@ -0,0 +1,152 @@ +[CmdletBinding()] +Param ( + [Parameter(Mandatory = $true)] + [string] + [ValidateNotNullOrEmpty()] + $LicenseXmlPath, + + # We do not need to use [SecureString] here since the value will be stored unencrypted in .env, + # and used only for transient local example environment. + [string] + $SitecoreAdminPassword = "Password12345", + + # We do not need to use [SecureString] here since the value will be stored unencrypted in .env, + # and used only for transient local example environment. + [string] + $SqlSaPassword = "Password12345" +) + +$ErrorActionPreference = "Stop"; + +if (-not (Test-Path $LicenseXmlPath)) { + throw "Did not find $LicenseXmlPath" +} +if (-not (Test-Path $LicenseXmlPath -PathType Leaf)) { + throw "$LicenseXmlPath is not a file" +} + +# Check for Sitecore Gallery +Import-Module PowerShellGet +$SitecoreGallery = Get-PSRepository | Where-Object { $_.SourceLocation -eq "https://nuget.sitecore.com/resources/v2/" } +if (-not $SitecoreGallery) { + Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green + Register-PSRepository -Name SitecoreGallery -SourceLocation https://nuget.sitecore.com/resources/v2/ -InstallationPolicy Trusted + $SitecoreGallery = Get-PSRepository -Name SitecoreGallery +} +# Install and Import SitecoreDockerTools +$dockerToolsVersion = "10.2.7" +Remove-Module SitecoreDockerTools -ErrorAction SilentlyContinue +if (-not (Get-InstalledModule -Name SitecoreDockerTools -RequiredVersion $dockerToolsVersion -ErrorAction SilentlyContinue)) { + Write-Host "Installing SitecoreDockerTools..." -ForegroundColor Green + Install-Module SitecoreDockerTools -RequiredVersion $dockerToolsVersion -Scope CurrentUser -Repository $SitecoreGallery.Name +} +Write-Host "Importing SitecoreDockerTools..." -ForegroundColor Green +Import-Module SitecoreDockerTools -RequiredVersion $dockerToolsVersion +Write-SitecoreDockerWelcome + +############################### +# Populate the environment file +############################### + +Write-Host "Populating required .env file variables..." -ForegroundColor Green + +# SITECORE_ADMIN_PASSWORD +Set-EnvFileVariable "SITECORE_ADMIN_PASSWORD" -Value $SitecoreAdminPassword + +# SQL_SA_PASSWORD +Set-EnvFileVariable "SQL_SA_PASSWORD" -Value $SqlSaPassword + +# TELERIK_ENCRYPTION_KEY = random 64-128 chars +Set-EnvFileVariable "TELERIK_ENCRYPTION_KEY" -Value "'$(Get-SitecoreRandomString 128)'" + +# MEDIA_REQUEST_PROTECTION_SHARED_SECRET +Set-EnvFileVariable "MEDIA_REQUEST_PROTECTION_SHARED_SECRET" -Value "'$(Get-SitecoreRandomString 64)'" + +# SITECORE_IDSECRET = random 64 chars +Set-EnvFileVariable "SITECORE_IDSECRET" -Value (Get-SitecoreRandomString 64 -DisallowSpecial) + +# SITECORE_ID_CERTIFICATE +$idCertPassword = Get-SitecoreRandomString 12 -DisallowSpecial +Set-EnvFileVariable "SITECORE_ID_CERTIFICATE" -Value (Get-SitecoreCertificateAsBase64String -DnsName "localhost" -Password (ConvertTo-SecureString -String $idCertPassword -Force -AsPlainText)) + +# SITECORE_ID_CERTIFICATE_PASSWORD +Set-EnvFileVariable "SITECORE_ID_CERTIFICATE_PASSWORD" -Value $idCertPassword + +# SITECORE_LICENSE +Set-EnvFileVariable "SITECORE_LICENSE" -Value (ConvertTo-CompressedBase64String -Path $LicenseXmlPath) + +################################## +# Get host names from .env +################################## + +$CM_HOST_1 = Get-EnvFileVariable CM_HOST_1 -Path (Resolve-Path .\.env) +$ID_HOST_1 = Get-EnvFileVariable ID_HOST_1 -Path (Resolve-Path .\.env) +$CM_HOST_2 = Get-EnvFileVariable CM_HOST_2 -Path (Resolve-Path .\.env) +$ID_HOST_2 = Get-EnvFileVariable ID_HOST_2 -Path (Resolve-Path .\.env) + +################################## +# Configure TLS/HTTPS certificates +################################## + +Push-Location traefik\certs +try { + $mkcert = ".\mkcert.exe" + if ($null -ne (Get-Command mkcert.exe -ErrorAction SilentlyContinue)) { + # mkcert installed in PATH + $mkcert = "mkcert" + } elseif (-not (Test-Path $mkcert)) { + Write-Host "Downloading and installing mkcert certificate tool..." -ForegroundColor Green + Invoke-WebRequest "https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-windows-amd64.exe" -UseBasicParsing -OutFile mkcert.exe + if ((Get-FileHash mkcert.exe).Hash -ne "1BE92F598145F61CA67DD9F5C687DFEC17953548D013715FF54067B34D7C3246") { + Remove-Item mkcert.exe -Force + throw "Invalid mkcert.exe file" + } + } + Write-Host "Generating Traefik TLS certificates..." -ForegroundColor Green + & $mkcert -install + & $mkcert -cert-file "$CM_HOST_1.crt" -key-file "$CM_HOST_1.key" "$CM_HOST_1" + & $mkcert -cert-file "$CM_HOST_2.crt" -key-file "$CM_HOST_2.key" "$CM_HOST_2" + & $mkcert -cert-file "$ID_HOST_1.crt" -key-file "$ID_HOST_1.key" "$ID_HOST_1" + & $mkcert -cert-file "$ID_HOST_2.crt" -key-file "$ID_HOST_2.key" "$ID_HOST_2" + +} +catch { + Write-Host "An error occurred while attempting to generate TLS certificates: $_" -ForegroundColor Red +} +finally { + Pop-Location +} + +################################ +# Update traefik dynamic config +################################ + +try { + + Write-Host "Updating .\traefik\config\dynamic\certs_config.yaml `..." -ForegroundColor Green + + (Get-Content .\traefik\config\dynamic\certs_config.yaml) ` + -replace '##CM_HOST_1##', $CM_HOST_1 ` + -replace '##CM_HOST_2##', $CM_HOST_2 ` + -replace '##ID_HOST_1##', $ID_HOST_1 ` + -replace '##ID_HOST_2##', $ID_HOST_2 | ` + Set-Content .\traefik\config\dynamic\certs_config.yaml ` +} +catch { + Write-Warning $Error[0] + Write-Host "An error occurred updating .\traefik\config\dynamic\certs_config.yaml" -ForegroundColor Red +} + + +################################ +# Add Windows hosts file entries +################################ + +Write-Host "Adding Windows hosts file entries..." -ForegroundColor Green + +Add-HostsEntry "$CM_HOST_1" +Add-HostsEntry "$CM_HOST_2" +Add-HostsEntry "$ID_HOST_1" +Add-HostsEntry "$ID_HOST_2" + +Write-Host "Done!" -ForegroundColor Green diff --git a/sitecore-compare/mssql-data/.gitkeep b/sitecore-compare/mssql-data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/sitecore-compare/solr-data/.gitkeep b/sitecore-compare/solr-data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/sitecore-compare/traefik/certs/.gitkeep b/sitecore-compare/traefik/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/sitecore-compare/traefik/config/dynamic/certs_config.yaml b/sitecore-compare/traefik/config/dynamic/certs_config.yaml new file mode 100644 index 0000000..18ef198 --- /dev/null +++ b/sitecore-compare/traefik/config/dynamic/certs_config.yaml @@ -0,0 +1,10 @@ +tls: + certificates: + - certFile: C:\etc\traefik\certs\##CM_HOST_1##.crt + keyFile: C:\etc\traefik\certs\##CM_HOST_1##.key + - certFile: C:\etc\traefik\certs\##ID_HOST_1##.crt + keyFile: C:\etc\traefik\certs\##ID_HOST_1##.key + - certFile: C:\etc\traefik\certs\##CM_HOST_2##.crt + keyFile: C:\etc\traefik\certs\##CM_HOST_2##.key + - certFile: C:\etc\traefik\certs\##ID_HOST_2##.crt + keyFile: C:\etc\traefik\certs\##ID_HOST_2##.key \ No newline at end of file