From 26a5512faaacee3bf63938af22b2d0679982cc9b Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sat, 26 Oct 2019 12:59:37 +0200 Subject: [PATCH 01/18] draft --- windows/9.2.0/sitecore-assets/Dockerfile | 8 ++- windows/9.2.x/sitecore-xm/Dockerfile | 5 ++ windows/9.2.x/sitecore-xm/boot/Boot.ps1 | 7 +++ windows/9.2.x/sitecore-xm/boot/filebeat.yml | 19 +++++++ .../9.2.x/sitecore-xm/config/Logging.config | 55 +++++++++++++++++++ windows/tests/9.x.x/docker-compose.xm.yml | 5 +- 6 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 windows/9.2.x/sitecore-xm/boot/Boot.ps1 create mode 100644 windows/9.2.x/sitecore-xm/boot/filebeat.yml create mode 100644 windows/9.2.x/sitecore-xm/config/Logging.config diff --git a/windows/9.2.0/sitecore-assets/Dockerfile b/windows/9.2.0/sitecore-assets/Dockerfile index 309b46708..bdc2913ec 100644 --- a/windows/9.2.0/sitecore-assets/Dockerfile +++ b/windows/9.2.0/sitecore-assets/Dockerfile @@ -11,7 +11,8 @@ RUN New-Item -Path 'C:\\downloads' -ItemType 'Directory' -Force | Out-Null; ` & curl.exe -sS -L -o c:\\downloads\\nuget.exe https://dist.nuget.org/win-x86-commandline/v5.2.0/nuget.exe; ` & curl.exe -sS -L -o C:\\downloads\\urlrewrite.msi https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi; ` & curl.exe -sS -L -o C:\\downloads\\vc_redist.exe https://aka.ms/vs/15/release/VC_redist.x64.exe; ` - & curl.exe -sS -L -o C:\\downloads\\7z-installer.exe https://www.7-zip.org/a/7z1900-x64.exe; + & curl.exe -sS -L -o C:\\downloads\\7z-installer.exe https://www.7-zip.org/a/7z1900-x64.exe; ` + & curl.exe -sS -L -o C:\\downloads\\filebeat.zip https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.4.1-windows-x86_64.zip; # copy local assets COPY *.zip C:\\downloads\\ @@ -32,6 +33,11 @@ RUN & 'C:\\install\\tools\\bin\\nuget.exe' install 'Microsoft.Web.Xdt' -Version Copy-Item -Path 'C:\\install\\Microsoft.Web.Xdt*\\lib\\netstandard2.0\\*.dll' -Destination 'C:\\install\\tools\\bin'; ` Remove-Item -Path (Get-Item -Path 'C:\\install\\Microsoft.Web.Xdt*\\').FullName -Recurse -Force; +# extract filebeat +RUN Expand-Archive -Path 'C:\\downloads\\filebeat.zip' -DestinationPath 'C:\\install\\tools\\bin' -Force; ` + Rename-Item -Path (Get-Item -Path 'C:\\install\\tools\\bin\\filebeat*windows*').FullName -NewName "filebeat"; ` + Remove-Item -Path 'C:\\downloads\\filebeat.zip' -Force; + # extract assets, skip wdps, move already extracted wdps RUN $zips = Get-ChildItem -Path 'C:\\downloads\\*.zip' -Exclude '*.scwdp.zip'; ` $zips | ForEach-Object { Expand-Archive -Path $_.FullName -DestinationPath 'C:\\packages' -Force; }; ` diff --git a/windows/9.2.x/sitecore-xm/Dockerfile b/windows/9.2.x/sitecore-xm/Dockerfile index e32a3bfc0..a520b0c87 100644 --- a/windows/9.2.x/sitecore-xm/Dockerfile +++ b/windows/9.2.x/sitecore-xm/Dockerfile @@ -41,6 +41,9 @@ RUN $xdts = (Get-ChildItem -Path 'C:\\inetpub\\wwwroot\\*.config.xdt'), (Get-Chi # add config patches COPY .\config\*.config C:\\inetpub\\wwwroot\\App_Config\\Include\\ +# add boot directory +COPY .\boot\ C:\\inetpub\\wwwroot\\temp\\install\\tools\\boot\\ + # add installers COPY --from=assets ["C:\\install\\setup\\", "C:\\inetpub\\wwwroot\\temp\\install\\setup\\"] @@ -76,3 +79,5 @@ RUN $env:INSTALL_TEMP = 'C:\\inetpub\\wwwroot\\temp\\install'; ` Set-WebConfigurationProperty -PSPath $env:IIS_SITE_PATH -Filter '/appSettings/add[@key=\"role:define\"]' -Name 'value' -Value $env:SC_ROLE_DEFINE; ` # delete temporary files Remove-Item -Path $env:INSTALL_TEMP -Force -Recurse; + +ENTRYPOINT ["powershell", "C:\\tools\\boot\\Boot.ps1"] \ No newline at end of file diff --git a/windows/9.2.x/sitecore-xm/boot/Boot.ps1 b/windows/9.2.x/sitecore-xm/boot/Boot.ps1 new file mode 100644 index 000000000..8332d5d1e --- /dev/null +++ b/windows/9.2.x/sitecore-xm/boot/Boot.ps1 @@ -0,0 +1,7 @@ +Start-Job -Name "ServiceMonitor" { + & C:\ServiceMonitor.exe "w3svc" + + Get-Process -Name "filebeat" | Stop-Process -Force +} | Out-Null + +& "C:\tools\bin\filebeat\filebeat.exe" -c "C:\tools\boot\filebeat.yml" \ No newline at end of file diff --git a/windows/9.2.x/sitecore-xm/boot/filebeat.yml b/windows/9.2.x/sitecore-xm/boot/filebeat.yml new file mode 100644 index 000000000..2e69e7049 --- /dev/null +++ b/windows/9.2.x/sitecore-xm/boot/filebeat.yml @@ -0,0 +1,19 @@ +filebeat.modules: +- module: iis + access: + enabled: ${FILEBEAT_IIS_ACCESS_LOG_ENABLED:false} + var.paths: ["C:/inetpub/logs/LogFiles/*/*.log"] + error: + enabled: ${FILEBEAT_IIS_ERROR_LOG_ENABLED:true} + var.paths: ["C:/Windows/System32/LogFiles/HTTPERR/*.log"] + +filebeat.inputs: +- type: udp + enabled: ${FILEBEAT_SITECORE_UDP_LOG_ENABLED:true} + max_message_size: 100KiB + host: "127.0.0.1:7777" + +output.console: + pretty: true + codec.format: + string: '%{[message]}' \ No newline at end of file diff --git a/windows/9.2.x/sitecore-xm/config/Logging.config b/windows/9.2.x/sitecore-xm/config/Logging.config new file mode 100644 index 000000000..7d2c3a86e --- /dev/null +++ b/windows/9.2.x/sitecore-xm/config/Logging.config @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/windows/tests/9.x.x/docker-compose.xm.yml b/windows/tests/9.x.x/docker-compose.xm.yml index 3cdbfee8a..1549e7e37 100644 --- a/windows/tests/9.x.x/docker-compose.xm.yml +++ b/windows/tests/9.x.x/docker-compose.xm.yml @@ -33,7 +33,10 @@ services: image: ${REGISTRY}sitecore-xm-cm:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - ${LICENSE_PATH}:C:\license - - .\data\cm:C:\inetpub\wwwroot\App_Data\logs + environment: + - "FILEBEAT_IIS_ACCESS_LOG_ENABLED=false" + - "FILEBEAT_IIS_ERROR_LOG_ENABLED=true" + - "FILEBEAT_SITECORE_UDP_LOG_ENABLED=true" ports: - "44001:80" links: From b7f4a46b51c349ef7d33abb9ffb88e11fbfe911a Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 17:03:42 +0100 Subject: [PATCH 02/18] finishing up --- CHANGELOG.md | 1 + README.md | 24 +++++++ windows/9.2.0/sitecore-assets/Dockerfile | 2 +- .../tools/entrypoints/iis/Development.ps1 | 66 +++++++++++++++++++ .../entrypoints/iis/EnableUdpLogging.config} | 48 ++++++++++++++ .../tools/entrypoints/iis/Production.ps1 | 25 +++++++ .../tools/entrypoints/iis}/filebeat.yml | 6 +- windows/9.2.x/sitecore-xm/Dockerfile | 5 -- windows/9.2.x/sitecore-xm/boot/Boot.ps1 | 7 -- windows/tests/9.x.x/docker-compose.xm.yml | 15 +++-- 10 files changed, 178 insertions(+), 21 deletions(-) create mode 100644 windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 rename windows/{9.2.x/sitecore-xm/config/Logging.config => 9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config} (51%) create mode 100644 windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 rename windows/{9.2.x/sitecore-xm/boot => 9.2.0/sitecore-assets/tools/entrypoints/iis}/filebeat.yml (63%) delete mode 100644 windows/9.2.x/sitecore-xm/boot/Boot.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index beaba6c3e..fca8c8616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## October 2019 +- [Added] New **optional** `ENTRYPOINT` scripts for IIS based images. See [README.md](/README.md#optional-entrypoint-scripts) for how to use. - [Changed] Windows and Linux `spe` "Sitecore PowerShell Extensions" images updated to **v6.0**, indirectly *also* updating all `sxa` images. See [#84](https://github.com/Sitecore/docker-images/issues/84). Thanks [@michaellwest](https://github.com/michaellwest) :+1: - [Changed] The `c:\tools\scripts\Watch-Directory.ps1` no longer deletes destination directories, only files. See [#89](https://github.com/Sitecore/docker-images/issues/89). Thanks [@sshushliapin](https://github.com/sshushliapin) :+1: - [Fixed] The `c:\tools` folder was empty. diff --git a/README.md b/README.md index 52ed2343f..e3e07a2e4 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,27 @@ SitecoreImageBuilder\Invoke-Build ` -Registry $registry ` -Tags $tags ``` + +### Optional ENTRYPOINT scripts + +For IIS based images (such as the roles `cm`, `standalone` and `cd`) we now have a few scripts that can be used as `ENTRYPOINT` for development and production use. + +Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in the `STDOUT` of containers in the foreground or by using commands such as `docker container logs` or `docker container attach`. + +`C:\tools\entrypoints\iis\Production.ps1` features: + +- Switches all log4net appenders from file to UDP. +- Starts `ServiceMonitor.exe` in the background. +- Starts `filebeat.exe` in the foreground and outputting to `STDOUT`. +- FileBeat inputs configured: + - IIS access logs, **disabled** by default, can be enable with environment variable: `ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=true` + - IIS error logs, **disabled** by default, enable with environment variable: `ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=true` + - Sitecore logs, **enabled** by default, enable with environment variable: `ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=true` + +`C:\tools\entrypoints\iis\Development.ps1` features: + +- Same as `Production.ps1`. +- Starts the Visual Studio Remote Debugger `msvsmon.exe` in the background **if** the Visual Studio Remote Debugger directory is mounted into `C:\remote_debugger`. +- Starts the `Watch-Directory.ps1` script in the background **if** a directory is mounted into `C:\src`. + +See the `cm` and `cd` service in [windows/tests/docker-compose.xm.yml](/windows/tests/docker-compose.xm.yml) for configuration examples. diff --git a/windows/9.2.0/sitecore-assets/Dockerfile b/windows/9.2.0/sitecore-assets/Dockerfile index bdc2913ec..07a0459d1 100644 --- a/windows/9.2.0/sitecore-assets/Dockerfile +++ b/windows/9.2.0/sitecore-assets/Dockerfile @@ -50,7 +50,7 @@ RUN New-Item -Path 'C:\\install\\setup' -ItemType 'Directory' -Force | Out-Null; Get-ChildItem 'C:\\downloads\\*.*' -Include '*.exe', '*.msi' | Move-Item -Destination 'C:\\install\\setup'; # add tools folder -COPY tools C:\\install\\tools +COPY tools\\ C:\\install\\tools\\ FROM $BASE_IMAGE diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 new file mode 100644 index 000000000..328216167 --- /dev/null +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 @@ -0,0 +1,66 @@ +# print welcome message +Write-Host ("### Sitecore Development ENTRYPOINT, starting...") + +# check to see if we should start the VS remote debugger +$useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true + +if ($useVsDebugger) +{ + # start msvsmon.exe in background + & "C:\remote_debugger\x64\msvsmon.exe" /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646 + + Write-Host ("### Started 'msvsmon.exe'.") +} +else +{ + Write-Host ("### Skipping start of 'msvsmon.exe', to enable you should mount the Visual Studio Remote Debugger directory into 'C:\remote_debugger'.") +} + +# check to see if we should start the Watch-Directory script +$useWatchDirectory = (Test-Path -Path "C:\src" -PathType "Container") -eq $true + +if ($useWatchDirectory) +{ + # start Watch-Directory.ps1 in background, kill foreground process if it fails + Start-Job -Name "WatchDirectory.ps1" { + try + { + # TODO: Handle additional Watch-Directory params, use param splattering? + + & "C:\tools\scripts\Watch-Directory.ps1" -Path "C:\src" -Destination "C:\inetpub\wwwroot" -ExcludeFiles "Web.config" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } + } | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") + } +} +else +{ + Write-Host ("### Skipping start of 'WatchDirectory.ps1', to enable you should mount a directory into 'C:\src'.") +} + +# inject Sitecore config files +Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" + +# start servicemonitor.exe in background, kill foreground process if it fails +Start-Job -Name "ServiceMonitor.exe" { + try + { + & "C:\ServiceMonitor.exe" "w3svc" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } +} | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") +} + +# print ready message +Write-Host ("### Sitecore ready!") + +# start filebeat.exe in foreground +& "C:\tools\bin\filebeat\filebeat.exe" -c (Join-Path $PSScriptRoot "\filebeat.yml") \ No newline at end of file diff --git a/windows/9.2.x/sitecore-xm/config/Logging.config b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config similarity index 51% rename from windows/9.2.x/sitecore-xm/config/Logging.config rename to windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index 7d2c3a86e..a79a8ecd3 100644 --- a/windows/9.2.x/sitecore-xm/config/Logging.config +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -50,6 +50,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 new file mode 100644 index 000000000..d8d906926 --- /dev/null +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 @@ -0,0 +1,25 @@ +# print welcome message +Write-Host ("### Sitecore Production ENTRYPOINT, starting...") + +# inject Sitecore config files +Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" + +# start servicemonitor.exe in background, kill foreground process if it fails +Start-Job -Name "ServiceMonitor.exe" { + try + { + & "C:\ServiceMonitor.exe" "w3svc" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } +} | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") +} + +# print ready message +Write-Host ("### Sitecore ready!") + +# start filebeat.exe in foreground +& "C:\tools\bin\filebeat\filebeat.exe" -c (Join-Path $PSScriptRoot "\filebeat.yml") \ No newline at end of file diff --git a/windows/9.2.x/sitecore-xm/boot/filebeat.yml b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/filebeat.yml similarity index 63% rename from windows/9.2.x/sitecore-xm/boot/filebeat.yml rename to windows/9.2.0/sitecore-assets/tools/entrypoints/iis/filebeat.yml index 2e69e7049..b66525024 100644 --- a/windows/9.2.x/sitecore-xm/boot/filebeat.yml +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/filebeat.yml @@ -1,15 +1,15 @@ filebeat.modules: - module: iis access: - enabled: ${FILEBEAT_IIS_ACCESS_LOG_ENABLED:false} + enabled: ${ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED:false} var.paths: ["C:/inetpub/logs/LogFiles/*/*.log"] error: - enabled: ${FILEBEAT_IIS_ERROR_LOG_ENABLED:true} + enabled: ${ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED:false} var.paths: ["C:/Windows/System32/LogFiles/HTTPERR/*.log"] filebeat.inputs: - type: udp - enabled: ${FILEBEAT_SITECORE_UDP_LOG_ENABLED:true} + enabled: ${ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED:true} max_message_size: 100KiB host: "127.0.0.1:7777" diff --git a/windows/9.2.x/sitecore-xm/Dockerfile b/windows/9.2.x/sitecore-xm/Dockerfile index a520b0c87..e32a3bfc0 100644 --- a/windows/9.2.x/sitecore-xm/Dockerfile +++ b/windows/9.2.x/sitecore-xm/Dockerfile @@ -41,9 +41,6 @@ RUN $xdts = (Get-ChildItem -Path 'C:\\inetpub\\wwwroot\\*.config.xdt'), (Get-Chi # add config patches COPY .\config\*.config C:\\inetpub\\wwwroot\\App_Config\\Include\\ -# add boot directory -COPY .\boot\ C:\\inetpub\\wwwroot\\temp\\install\\tools\\boot\\ - # add installers COPY --from=assets ["C:\\install\\setup\\", "C:\\inetpub\\wwwroot\\temp\\install\\setup\\"] @@ -79,5 +76,3 @@ RUN $env:INSTALL_TEMP = 'C:\\inetpub\\wwwroot\\temp\\install'; ` Set-WebConfigurationProperty -PSPath $env:IIS_SITE_PATH -Filter '/appSettings/add[@key=\"role:define\"]' -Name 'value' -Value $env:SC_ROLE_DEFINE; ` # delete temporary files Remove-Item -Path $env:INSTALL_TEMP -Force -Recurse; - -ENTRYPOINT ["powershell", "C:\\tools\\boot\\Boot.ps1"] \ No newline at end of file diff --git a/windows/9.2.x/sitecore-xm/boot/Boot.ps1 b/windows/9.2.x/sitecore-xm/boot/Boot.ps1 deleted file mode 100644 index 8332d5d1e..000000000 --- a/windows/9.2.x/sitecore-xm/boot/Boot.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -Start-Job -Name "ServiceMonitor" { - & C:\ServiceMonitor.exe "w3svc" - - Get-Process -Name "filebeat" | Stop-Process -Force -} | Out-Null - -& "C:\tools\bin\filebeat\filebeat.exe" -c "C:\tools\boot\filebeat.yml" \ No newline at end of file diff --git a/windows/tests/9.x.x/docker-compose.xm.yml b/windows/tests/9.x.x/docker-compose.xm.yml index 1549e7e37..780d40c15 100644 --- a/windows/tests/9.x.x/docker-compose.xm.yml +++ b/windows/tests/9.x.x/docker-compose.xm.yml @@ -20,9 +20,13 @@ services: cd: image: ${REGISTRY}sitecore-xm-cd:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} + entrypoint: powershell.exe -NoLogo -File C:\\tools\\entrypoints\\iis\\Development.ps1 + environment: + - "ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=true" + - "ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=true" + - "ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=true" volumes: - ${LICENSE_PATH}:C:\license - - .\data\cd:C:\inetpub\wwwroot\App_Data\logs ports: - "44002:80" links: @@ -31,12 +35,13 @@ services: cm: image: ${REGISTRY}sitecore-xm-cm:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} + entrypoint: powershell.exe -NoLogo -File C:\\tools\\entrypoints\\iis\\Development.ps1 + environment: + - "ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=false" + - "ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=false" + - "ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=true" volumes: - ${LICENSE_PATH}:C:\license - environment: - - "FILEBEAT_IIS_ACCESS_LOG_ENABLED=false" - - "FILEBEAT_IIS_ERROR_LOG_ENABLED=true" - - "FILEBEAT_SITECORE_UDP_LOG_ENABLED=true" ports: - "44001:80" links: From 4921d5d98c7169ccb837f63697a487dd641b35ae Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 17:06:35 +0100 Subject: [PATCH 03/18] fixing link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e3e07a2e4..6ad73b4a3 100644 --- a/README.md +++ b/README.md @@ -155,4 +155,4 @@ Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in - Starts the Visual Studio Remote Debugger `msvsmon.exe` in the background **if** the Visual Studio Remote Debugger directory is mounted into `C:\remote_debugger`. - Starts the `Watch-Directory.ps1` script in the background **if** a directory is mounted into `C:\src`. -See the `cm` and `cd` service in [windows/tests/docker-compose.xm.yml](/windows/tests/docker-compose.xm.yml) for configuration examples. +See the `cm` and `cd` service in [windows/tests/docker-compose.xm.yml](windows/tests/docker-compose.xm.yml) for configuration examples. From 619a8d730db9965c44b4a7726dfeb5a869cecba1 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 17:07:24 +0100 Subject: [PATCH 04/18] fixing link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ad73b4a3..9f2e893c5 100644 --- a/README.md +++ b/README.md @@ -155,4 +155,4 @@ Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in - Starts the Visual Studio Remote Debugger `msvsmon.exe` in the background **if** the Visual Studio Remote Debugger directory is mounted into `C:\remote_debugger`. - Starts the `Watch-Directory.ps1` script in the background **if** a directory is mounted into `C:\src`. -See the `cm` and `cd` service in [windows/tests/docker-compose.xm.yml](windows/tests/docker-compose.xm.yml) for configuration examples. +See the `cm` and `cd` service in [windows/tests/9.x.x/docker-compose.xm.yml](windows/tests/docker-compose.xm.yml) for configuration examples. From eeee7dc45266e06fac5d87134dd645e82a80af59 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 17:07:57 +0100 Subject: [PATCH 05/18] fixing link!!! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f2e893c5..4578a8b77 100644 --- a/README.md +++ b/README.md @@ -155,4 +155,4 @@ Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in - Starts the Visual Studio Remote Debugger `msvsmon.exe` in the background **if** the Visual Studio Remote Debugger directory is mounted into `C:\remote_debugger`. - Starts the `Watch-Directory.ps1` script in the background **if** a directory is mounted into `C:\src`. -See the `cm` and `cd` service in [windows/tests/9.x.x/docker-compose.xm.yml](windows/tests/docker-compose.xm.yml) for configuration examples. +See the `cm` and `cd` service in [windows/tests/9.x.x/docker-compose.xm.yml](windows/tests/9.x.x/docker-compose.xm.yml) for configuration examples. From abd0491309c4b4387d7dd41c9ec06340efd2f535 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 18:36:42 +0100 Subject: [PATCH 06/18] adding entrypoint assets to 9.1.1 and 9.0.2 --- windows/9.0.2/sitecore-assets/Dockerfile | 10 +- .../entrypoints/iis/Development.ps1 | 66 +++++++++++ .../entrypoints/iis/EnableUdpLogging.config | 103 ++++++++++++++++++ .../entrypoints/iis/Production.ps1 | 25 +++++ .../entrypoints/iis/filebeat.yml | 19 ++++ windows/9.1.1/sitecore-assets/Dockerfile | 10 +- .../tools/entrypoints/iis/Development.ps1 | 66 +++++++++++ .../entrypoints/iis/EnableUdpLogging.config | 103 ++++++++++++++++++ .../tools/entrypoints/iis/Production.ps1 | 25 +++++ .../tools/entrypoints/iis/filebeat.yml | 19 ++++ 10 files changed, 442 insertions(+), 4 deletions(-) create mode 100644 windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 create mode 100644 windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config create mode 100644 windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 create mode 100644 windows/9.0.2/sitecore-assets/entrypoints/iis/filebeat.yml create mode 100644 windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 create mode 100644 windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config create mode 100644 windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 create mode 100644 windows/9.1.1/sitecore-assets/tools/entrypoints/iis/filebeat.yml diff --git a/windows/9.0.2/sitecore-assets/Dockerfile b/windows/9.0.2/sitecore-assets/Dockerfile index 8bc8ae4be..4a050c976 100644 --- a/windows/9.0.2/sitecore-assets/Dockerfile +++ b/windows/9.0.2/sitecore-assets/Dockerfile @@ -11,7 +11,8 @@ RUN New-Item -Path 'C:\\downloads' -ItemType 'Directory' -Force | Out-Null; ` & curl.exe -sS -L -o c:\\downloads\\nuget.exe https://dist.nuget.org/win-x86-commandline/v5.2.0/nuget.exe; ` & curl.exe -sS -L -o C:\\downloads\\urlrewrite.msi https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi; ` & curl.exe -sS -L -o C:\\downloads\\vc_redist.exe https://aka.ms/vs/15/release/VC_redist.x64.exe; ` - & curl.exe -sS -L -o C:\\downloads\\7z-installer.exe https://www.7-zip.org/a/7z1900-x64.exe; + & curl.exe -sS -L -o C:\\downloads\\7z-installer.exe https://www.7-zip.org/a/7z1900-x64.exe; ` + & curl.exe -sS -L -o C:\\downloads\\filebeat.zip https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.4.1-windows-x86_64.zip; # copy local assets COPY *.zip C:\\downloads\\ @@ -31,6 +32,11 @@ RUN & 'C:\\install\\tools\\bin\\nuget.exe' install 'Microsoft.Web.Xdt' -Version Copy-Item -Path 'C:\\install\\Microsoft.Web.Xdt*\\lib\\netstandard2.0\\*.dll' -Destination 'C:\\install\\tools\\bin'; ` Remove-Item -Path (Get-Item -Path 'C:\\install\\Microsoft.Web.Xdt*\\').FullName -Recurse -Force; +# extract filebeat +RUN Expand-Archive -Path 'C:\\downloads\\filebeat.zip' -DestinationPath 'C:\\install\\tools\\bin' -Force; ` + Rename-Item -Path (Get-Item -Path 'C:\\install\\tools\\bin\\filebeat*windows*').FullName -NewName "filebeat"; ` + Remove-Item -Path 'C:\\downloads\\filebeat.zip' -Force; + # extract assets, skip wdps, move already extracted wdps RUN $zips = Get-ChildItem -Path 'C:\\downloads\\*.zip' -Exclude '*.scwdp.zip'; ` $zips | ForEach-Object { ` @@ -46,7 +52,7 @@ RUN New-Item -Path 'C:\\install\\setup' -ItemType 'Directory' -Force | Out-Null; Get-ChildItem 'C:\\downloads\\*.*' -Include '*.exe', '*.msi' | Move-Item -Destination 'C:\\install\\setup'; # add tools folder -COPY tools C:\\install\\tools +COPY tools\\ C:\\install\\tools\\ FROM $BASE_IMAGE diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 b/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 new file mode 100644 index 000000000..328216167 --- /dev/null +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 @@ -0,0 +1,66 @@ +# print welcome message +Write-Host ("### Sitecore Development ENTRYPOINT, starting...") + +# check to see if we should start the VS remote debugger +$useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true + +if ($useVsDebugger) +{ + # start msvsmon.exe in background + & "C:\remote_debugger\x64\msvsmon.exe" /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646 + + Write-Host ("### Started 'msvsmon.exe'.") +} +else +{ + Write-Host ("### Skipping start of 'msvsmon.exe', to enable you should mount the Visual Studio Remote Debugger directory into 'C:\remote_debugger'.") +} + +# check to see if we should start the Watch-Directory script +$useWatchDirectory = (Test-Path -Path "C:\src" -PathType "Container") -eq $true + +if ($useWatchDirectory) +{ + # start Watch-Directory.ps1 in background, kill foreground process if it fails + Start-Job -Name "WatchDirectory.ps1" { + try + { + # TODO: Handle additional Watch-Directory params, use param splattering? + + & "C:\tools\scripts\Watch-Directory.ps1" -Path "C:\src" -Destination "C:\inetpub\wwwroot" -ExcludeFiles "Web.config" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } + } | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") + } +} +else +{ + Write-Host ("### Skipping start of 'WatchDirectory.ps1', to enable you should mount a directory into 'C:\src'.") +} + +# inject Sitecore config files +Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" + +# start servicemonitor.exe in background, kill foreground process if it fails +Start-Job -Name "ServiceMonitor.exe" { + try + { + & "C:\ServiceMonitor.exe" "w3svc" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } +} | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") +} + +# print ready message +Write-Host ("### Sitecore ready!") + +# start filebeat.exe in foreground +& "C:\tools\bin\filebeat\filebeat.exe" -c (Join-Path $PSScriptRoot "\filebeat.yml") \ No newline at end of file diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config new file mode 100644 index 000000000..a79a8ecd3 --- /dev/null +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 b/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 new file mode 100644 index 000000000..d8d906926 --- /dev/null +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 @@ -0,0 +1,25 @@ +# print welcome message +Write-Host ("### Sitecore Production ENTRYPOINT, starting...") + +# inject Sitecore config files +Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" + +# start servicemonitor.exe in background, kill foreground process if it fails +Start-Job -Name "ServiceMonitor.exe" { + try + { + & "C:\ServiceMonitor.exe" "w3svc" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } +} | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") +} + +# print ready message +Write-Host ("### Sitecore ready!") + +# start filebeat.exe in foreground +& "C:\tools\bin\filebeat\filebeat.exe" -c (Join-Path $PSScriptRoot "\filebeat.yml") \ No newline at end of file diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/filebeat.yml b/windows/9.0.2/sitecore-assets/entrypoints/iis/filebeat.yml new file mode 100644 index 000000000..b66525024 --- /dev/null +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/filebeat.yml @@ -0,0 +1,19 @@ +filebeat.modules: +- module: iis + access: + enabled: ${ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED:false} + var.paths: ["C:/inetpub/logs/LogFiles/*/*.log"] + error: + enabled: ${ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED:false} + var.paths: ["C:/Windows/System32/LogFiles/HTTPERR/*.log"] + +filebeat.inputs: +- type: udp + enabled: ${ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED:true} + max_message_size: 100KiB + host: "127.0.0.1:7777" + +output.console: + pretty: true + codec.format: + string: '%{[message]}' \ No newline at end of file diff --git a/windows/9.1.1/sitecore-assets/Dockerfile b/windows/9.1.1/sitecore-assets/Dockerfile index e645e7324..53e4a7e2d 100644 --- a/windows/9.1.1/sitecore-assets/Dockerfile +++ b/windows/9.1.1/sitecore-assets/Dockerfile @@ -11,7 +11,8 @@ RUN New-Item -Path 'C:\\downloads' -ItemType 'Directory' -Force | Out-Null; ` & curl.exe -sS -L -o c:\\downloads\\nuget.exe https://dist.nuget.org/win-x86-commandline/v5.2.0/nuget.exe; ` & curl.exe -sS -L -o C:\\downloads\\urlrewrite.msi https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi; ` & curl.exe -sS -L -o C:\\downloads\\vc_redist.exe https://aka.ms/vs/15/release/VC_redist.x64.exe; ` - & curl.exe -sS -L -o C:\\downloads\\7z-installer.exe https://www.7-zip.org/a/7z1900-x64.exe; + & curl.exe -sS -L -o C:\\downloads\\7z-installer.exe https://www.7-zip.org/a/7z1900-x64.exe; ` + & curl.exe -sS -L -o C:\\downloads\\filebeat.zip https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.4.1-windows-x86_64.zip; # copy local assets COPY *.zip C:\\downloads\\ @@ -31,6 +32,11 @@ RUN & 'C:\\install\\tools\\bin\\nuget.exe' install 'Microsoft.Web.Xdt' -Version Copy-Item -Path 'C:\\install\\Microsoft.Web.Xdt*\\lib\\netstandard2.0\\*.dll' -Destination 'C:\\install\\tools\\bin'; ` Remove-Item -Path (Get-Item -Path 'C:\\install\\Microsoft.Web.Xdt*\\').FullName -Recurse -Force; +# extract filebeat +RUN Expand-Archive -Path 'C:\\downloads\\filebeat.zip' -DestinationPath 'C:\\install\\tools\\bin' -Force; ` + Rename-Item -Path (Get-Item -Path 'C:\\install\\tools\\bin\\filebeat*windows*').FullName -NewName "filebeat"; ` + Remove-Item -Path 'C:\\downloads\\filebeat.zip' -Force; + # extract assets, skip wdps, move already extracted wdps RUN $zips = Get-ChildItem -Path 'C:\\downloads\\*.zip' -Exclude '*.scwdp.zip'; ` $zips | ForEach-Object { Expand-Archive -Path $_.FullName -DestinationPath 'C:\\packages' -Force; }; ` @@ -43,7 +49,7 @@ RUN New-Item -Path 'C:\\install\\setup' -ItemType 'Directory' -Force | Out-Null; Get-ChildItem 'C:\\downloads\\*.*' -Include '*.exe', '*.msi' | Move-Item -Destination 'C:\\install\\setup'; # add tools folder -COPY tools C:\\install\\tools +COPY tools\\ C:\\install\\tools\\ FROM $BASE_IMAGE diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 new file mode 100644 index 000000000..328216167 --- /dev/null +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 @@ -0,0 +1,66 @@ +# print welcome message +Write-Host ("### Sitecore Development ENTRYPOINT, starting...") + +# check to see if we should start the VS remote debugger +$useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true + +if ($useVsDebugger) +{ + # start msvsmon.exe in background + & "C:\remote_debugger\x64\msvsmon.exe" /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646 + + Write-Host ("### Started 'msvsmon.exe'.") +} +else +{ + Write-Host ("### Skipping start of 'msvsmon.exe', to enable you should mount the Visual Studio Remote Debugger directory into 'C:\remote_debugger'.") +} + +# check to see if we should start the Watch-Directory script +$useWatchDirectory = (Test-Path -Path "C:\src" -PathType "Container") -eq $true + +if ($useWatchDirectory) +{ + # start Watch-Directory.ps1 in background, kill foreground process if it fails + Start-Job -Name "WatchDirectory.ps1" { + try + { + # TODO: Handle additional Watch-Directory params, use param splattering? + + & "C:\tools\scripts\Watch-Directory.ps1" -Path "C:\src" -Destination "C:\inetpub\wwwroot" -ExcludeFiles "Web.config" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } + } | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") + } +} +else +{ + Write-Host ("### Skipping start of 'WatchDirectory.ps1', to enable you should mount a directory into 'C:\src'.") +} + +# inject Sitecore config files +Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" + +# start servicemonitor.exe in background, kill foreground process if it fails +Start-Job -Name "ServiceMonitor.exe" { + try + { + & "C:\ServiceMonitor.exe" "w3svc" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } +} | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") +} + +# print ready message +Write-Host ("### Sitecore ready!") + +# start filebeat.exe in foreground +& "C:\tools\bin\filebeat\filebeat.exe" -c (Join-Path $PSScriptRoot "\filebeat.yml") \ No newline at end of file diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config new file mode 100644 index 000000000..a79a8ecd3 --- /dev/null +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 new file mode 100644 index 000000000..d8d906926 --- /dev/null +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 @@ -0,0 +1,25 @@ +# print welcome message +Write-Host ("### Sitecore Production ENTRYPOINT, starting...") + +# inject Sitecore config files +Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" + +# start servicemonitor.exe in background, kill foreground process if it fails +Start-Job -Name "ServiceMonitor.exe" { + try + { + & "C:\ServiceMonitor.exe" "w3svc" + } + finally + { + Get-Process -Name "filebeat" | Stop-Process -Force + } +} | ForEach-Object { + Write-Host ("### Started '$($_.Name)'.") +} + +# print ready message +Write-Host ("### Sitecore ready!") + +# start filebeat.exe in foreground +& "C:\tools\bin\filebeat\filebeat.exe" -c (Join-Path $PSScriptRoot "\filebeat.yml") \ No newline at end of file diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/filebeat.yml b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/filebeat.yml new file mode 100644 index 000000000..b66525024 --- /dev/null +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/filebeat.yml @@ -0,0 +1,19 @@ +filebeat.modules: +- module: iis + access: + enabled: ${ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED:false} + var.paths: ["C:/inetpub/logs/LogFiles/*/*.log"] + error: + enabled: ${ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED:false} + var.paths: ["C:/Windows/System32/LogFiles/HTTPERR/*.log"] + +filebeat.inputs: +- type: udp + enabled: ${ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED:true} + max_message_size: 100KiB + host: "127.0.0.1:7777" + +output.console: + pretty: true + codec.format: + string: '%{[message]}' \ No newline at end of file From 651d14144a3ab30e9de7321436d75447710579cf Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 20:51:41 +0100 Subject: [PATCH 07/18] aligning udp log output --- .../entrypoints/iis/EnableUdpLogging.config | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index a79a8ecd3..839a5321c 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -1,13 +1,20 @@ + + + + + + + - + @@ -15,7 +22,7 @@ - + @@ -23,7 +30,7 @@ - + @@ -31,7 +38,7 @@ - + @@ -39,7 +46,7 @@ - + @@ -47,7 +54,7 @@ - + @@ -55,7 +62,7 @@ - + @@ -63,7 +70,7 @@ - + @@ -71,7 +78,7 @@ - + @@ -79,7 +86,7 @@ - + @@ -87,7 +94,7 @@ - + @@ -95,7 +102,7 @@ - + From c7bebb3ce7d77345e8562da6e7c7d22397a4f370 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 20:55:54 +0100 Subject: [PATCH 08/18] aligned udp log output --- .../entrypoints/iis/EnableUdpLogging.config | 34 ++++++++++++------- .../entrypoints/iis/EnableUdpLogging.config | 34 ++++++++++++------- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config index a79a8ecd3..909527c66 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config @@ -1,13 +1,21 @@ - + + + + + + + + - + @@ -15,7 +23,7 @@ - + @@ -23,7 +31,7 @@ - + @@ -31,7 +39,7 @@ - + @@ -39,7 +47,7 @@ - + @@ -47,7 +55,7 @@ - + @@ -55,7 +63,7 @@ - + @@ -63,7 +71,7 @@ - + @@ -71,7 +79,7 @@ - + @@ -79,7 +87,7 @@ - + @@ -87,7 +95,7 @@ - + @@ -95,7 +103,7 @@ - + diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index a79a8ecd3..909527c66 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -1,13 +1,21 @@ - + + + + + + + + - + @@ -15,7 +23,7 @@ - + @@ -23,7 +31,7 @@ - + @@ -31,7 +39,7 @@ - + @@ -39,7 +47,7 @@ - + @@ -47,7 +55,7 @@ - + @@ -55,7 +63,7 @@ - + @@ -63,7 +71,7 @@ - + @@ -71,7 +79,7 @@ - + @@ -79,7 +87,7 @@ - + @@ -87,7 +95,7 @@ - + @@ -95,7 +103,7 @@ - + From f515411687f471af41c11f858fdf65ff0c2339d8 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 20:57:10 +0100 Subject: [PATCH 09/18] cleanup --- .../sitecore-assets/entrypoints/iis/EnableUdpLogging.config | 3 +-- .../tools/entrypoints/iis/EnableUdpLogging.config | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config index 909527c66..839a5321c 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config @@ -1,6 +1,5 @@ - + diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index 909527c66..839a5321c 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -1,6 +1,5 @@ - + From c6011998ec19a4689b7646f86114fcb4a11aa47c Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Sun, 27 Oct 2019 20:59:37 +0100 Subject: [PATCH 10/18] cleanup --- .../entrypoints/iis/EnableUdpLogging.config | 22 +++++++++---------- .../entrypoints/iis/EnableUdpLogging.config | 22 +++++++++---------- .../entrypoints/iis/EnableUdpLogging.config | 22 +++++++++---------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config index 839a5321c..798229600 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index 839a5321c..798229600 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index 839a5321c..798229600 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,7 +102,7 @@ - + From abe9c36dfa9b1548799d0cba15dbbd1a5fa962ef Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Mon, 28 Oct 2019 09:28:45 +0100 Subject: [PATCH 11/18] reconfigured UDP logging so we don't modify existing appenders, leaving files on disk --- README.md | 2 +- .../entrypoints/iis/EnableUdpLogging.config | 95 ++++++++++++++----- .../entrypoints/iis/EnableUdpLogging.config | 95 ++++++++++++++----- .../entrypoints/iis/EnableUdpLogging.config | 95 ++++++++++++++----- 4 files changed, 214 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 4578a8b77..ce5dffc36 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in `C:\tools\entrypoints\iis\Production.ps1` features: -- Switches all log4net appenders from file to UDP. +- Adds an UDP appender to all default log4net loggers. - Starts `ServiceMonitor.exe` in the background. - Starts `filebeat.exe` in the foreground and outputting to `STDOUT`. - FileBeat inputs configured: diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config index 798229600..df4cb5f34 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config @@ -9,102 +9,149 @@ - + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + + + + \ No newline at end of file diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index 798229600..df4cb5f34 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -9,102 +9,149 @@ - + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + + + + \ No newline at end of file diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index 798229600..df4cb5f34 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -9,102 +9,149 @@ - + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + - + + + + + - + + + + \ No newline at end of file From 36c3954e28c30f08f20bf3b1218d5fdd98d3b998 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Mon, 28 Oct 2019 20:40:15 +0100 Subject: [PATCH 12/18] testing --- .../tools/entrypoints/iis/Development.ps1 | 135 +++++++++++++++++- .../tools/entrypoints/iis/Production.ps1 | 2 + 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 index 328216167..cf8d50a3c 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 @@ -1,6 +1,82 @@ +$ErrorActionPreference = "STOP" + +Import-Module WebAdministration + +$iisWebsiteName = "Default Web Site" +$iisApplicationPoolName = "DefaultAppPool" + # print welcome message Write-Host ("### Sitecore Development ENTRYPOINT, starting...") +# wait for w3wp to stop +while ($true) +{ + $processName = "w3wp" + + Write-Host "### Waiting for process '$processName' to stop..." + + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + + $processes = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue") + + if ($processes.Length -eq 0) + { + Write-Host "### Process '$processName' stopped..." + + break; + } + + Start-Sleep -Seconds 1 +} + +# wait for site to stop +while ($true) +{ + $requiredState = "Stopped" + + Write-Host "### Waiting on site '$iisWebsiteName' state to be '$requiredState'..." + + $item = Get-ItemProperty "IIS:\Sites\$iisWebsiteName" + + if ($null -ne $item -and $item.State -ne $requiredState) + { + $item = Stop-WebSite -Name $iisWebsiteName -Passthru -ErrorAction "SilentlyContinue" + } + + if ($null -ne $item -and $item.State -eq $requiredState) + { + Write-Host "### Site '$iisWebsiteName' state is now '$requiredState'..." + + break + } + + Start-Sleep -Seconds 1 +} + +# wait for application pool to stop +while ($true) +{ + $requiredState = "Stopped" + + Write-Host "### Waiting on application pool '$iisApplicationPoolName' state to be '$requiredState'..." + + $item = Get-ItemProperty "IIS:\AppPools\$iisApplicationPoolName" + + if ($null -ne $item -and $item.State -ne $requiredState) + { + $item = Stop-WebAppPool -Name $iisApplicationPoolName -Passthru -ErrorAction "SilentlyContinue" + } + + if ($null -ne $item -and $item.State -eq $requiredState) + { + Write-Host "### Application pool '$iisApplicationPoolName' state is now '$requiredState'." + + break + } + + Start-Sleep -Seconds 1 +} + # check to see if we should start the VS remote debugger $useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true @@ -55,8 +131,63 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} | ForEach-Object { - Write-Host ("### Started '$($_.Name)'.") +} + +# wait for ServiceMonitor to start +while ($true) +{ + $processName = "ServiceMonitor" + + Write-Host "### Waiting for process '$processName' to start..." + + $processes = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue") + + if ($processes.Length -eq 1) + { + Write-Host "### Process '$processName' started..." + + break; + } + + Start-Sleep -Seconds 1 +} + +# wait for application pool to start +while ($true) +{ + $requiredState = "Started" + + Write-Host "### Waiting on application pool '$iisApplicationPoolName' state to be '$requiredState'..." + + $item = Start-WebAppPool -Name $iisApplicationPoolName -Passthru -ErrorAction "SilentlyContinue" + + if ($null -ne $item -and $item.State -eq $requiredState) + { + Write-Host "### Application pool '$iisApplicationPoolName' state is now '$requiredState'." + + break + } + + Start-Sleep -Seconds 1 +} + +# wait for site to start +while ($true) +{ + $requiredState = "Started" + + Write-Host "### Waiting on site '$iisWebsiteName' state to be '$requiredState'..." + + $item = Start-WebSite -Name $iisWebsiteName -Passthru -ErrorAction "SilentlyContinue" + + if ($null -ne $item -and $item.State -eq $requiredState) + { + Write-Host "### Site '$iisWebsiteName' state is now '$requiredState'." + + break + } + + Start-Sleep -Seconds 1 } # print ready message diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 index d8d906926..13e147830 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 @@ -1,3 +1,5 @@ +$ErrorActionPreference = "STOP" + # print welcome message Write-Host ("### Sitecore Production ENTRYPOINT, starting...") From 94ca25ec7f5b78762e7689c272554c5c36f8255c Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Mon, 28 Oct 2019 22:51:29 +0100 Subject: [PATCH 13/18] fix the startup timing issue --- .../tools/entrypoints/iis/Development.ps1 | 158 +++++++----------- .../tools/entrypoints/iis/Production.ps1 | 103 +++++++++++- windows/tests/9.x.x/docker-compose.xm.yml | 4 +- 3 files changed, 163 insertions(+), 102 deletions(-) diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 index cf8d50a3c..28afc93c0 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Development.ps1 @@ -1,83 +1,84 @@ +# setup $ErrorActionPreference = "STOP" Import-Module WebAdministration -$iisWebsiteName = "Default Web Site" -$iisApplicationPoolName = "DefaultAppPool" - -# print welcome message -Write-Host ("### Sitecore Development ENTRYPOINT, starting...") - -# wait for w3wp to stop -while ($true) +function Wait-WebItemState { - $processName = "w3wp" - - Write-Host "### Waiting for process '$processName' to stop..." + param( + [ValidateNotNullOrEmpty()] + [string]$IISPath + , + [ValidateSet("Started", "Stopped")] + [string]$State + ) + + while ($true) + { + Write-Host "### Waiting on item '$IISPath' state to be '$State'..." - Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + try + { + $item = Get-Item -Path $IISPath + + if ($null -ne $item -and $item.State -ne $State) + { + if ($State -eq "Started") + { + $item = Start-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + elseif ($State -eq "Stopped") + { + $item = Stop-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + } + } + catch + { + $item = $null + } - $processes = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue") + if ($null -ne $item -and $item.State -eq $State) + { + Write-Host "### Waiting on item '$IISPath' completed." - if ($processes.Length -eq 0) - { - Write-Host "### Process '$processName' stopped..." + break + } - break; + Start-Sleep -Milliseconds 500 } - - Start-Sleep -Seconds 1 } -# wait for site to stop +# print start message +Write-Host ("### Sitecore Development ENTRYPOINT, starting...") + +# wait for w3wp to stop while ($true) { - $requiredState = "Stopped" + $processName = "w3wp" - Write-Host "### Waiting on site '$iisWebsiteName' state to be '$requiredState'..." + Write-Host "### Waiting for process '$processName' to stop..." - $item = Get-ItemProperty "IIS:\Sites\$iisWebsiteName" + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -gt 0 - if ($null -ne $item -and $item.State -ne $requiredState) + if ($running) { - $item = Stop-WebSite -Name $iisWebsiteName -Passthru -ErrorAction "SilentlyContinue" + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" } - - if ($null -ne $item -and $item.State -eq $requiredState) + else { - Write-Host "### Site '$iisWebsiteName' state is now '$requiredState'..." + Write-Host "### Process '$processName' stopped..." - break + break; } - Start-Sleep -Seconds 1 + Start-Sleep -Milliseconds 500 } # wait for application pool to stop -while ($true) -{ - $requiredState = "Stopped" - - Write-Host "### Waiting on application pool '$iisApplicationPoolName' state to be '$requiredState'..." - - $item = Get-ItemProperty "IIS:\AppPools\$iisApplicationPoolName" +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Stopped" - if ($null -ne $item -and $item.State -ne $requiredState) - { - $item = Stop-WebAppPool -Name $iisApplicationPoolName -Passthru -ErrorAction "SilentlyContinue" - } - - if ($null -ne $item -and $item.State -eq $requiredState) - { - Write-Host "### Application pool '$iisApplicationPoolName' state is now '$requiredState'." - - break - } - - Start-Sleep -Seconds 1 -} - -# check to see if we should start the VS remote debugger +# check to see if we should start the msvsmon.exe $useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true if ($useVsDebugger) @@ -92,7 +93,7 @@ else Write-Host ("### Skipping start of 'msvsmon.exe', to enable you should mount the Visual Studio Remote Debugger directory into 'C:\remote_debugger'.") } -# check to see if we should start the Watch-Directory script +# check to see if we should start the Watch-Directory.ps1 script $useWatchDirectory = (Test-Path -Path "C:\src" -PathType "Container") -eq $true if ($useWatchDirectory) @@ -121,7 +122,7 @@ else # inject Sitecore config files Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" -# start servicemonitor.exe in background, kill foreground process if it fails +# start ServiceMonitor.exe in background, kill foreground process if it fails Start-Job -Name "ServiceMonitor.exe" { try { @@ -131,64 +132,29 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} +} | Out-Null -# wait for ServiceMonitor to start +# wait for the ServiceMonitor.exe process is running while ($true) { $processName = "ServiceMonitor" Write-Host "### Waiting for process '$processName' to start..." - $processes = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue") + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -eq 1 - if ($processes.Length -eq 1) + if ($running) { Write-Host "### Process '$processName' started..." break; } - Start-Sleep -Seconds 1 + Start-Sleep -Milliseconds 500 } # wait for application pool to start -while ($true) -{ - $requiredState = "Started" - - Write-Host "### Waiting on application pool '$iisApplicationPoolName' state to be '$requiredState'..." - - $item = Start-WebAppPool -Name $iisApplicationPoolName -Passthru -ErrorAction "SilentlyContinue" - - if ($null -ne $item -and $item.State -eq $requiredState) - { - Write-Host "### Application pool '$iisApplicationPoolName' state is now '$requiredState'." - - break - } - - Start-Sleep -Seconds 1 -} - -# wait for site to start -while ($true) -{ - $requiredState = "Started" - - Write-Host "### Waiting on site '$iisWebsiteName' state to be '$requiredState'..." - - $item = Start-WebSite -Name $iisWebsiteName -Passthru -ErrorAction "SilentlyContinue" - - if ($null -ne $item -and $item.State -eq $requiredState) - { - Write-Host "### Site '$iisWebsiteName' state is now '$requiredState'." - - break - } - - Start-Sleep -Seconds 1 -} +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Started" # print ready message Write-Host ("### Sitecore ready!") diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 index 13e147830..7daaad66b 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/Production.ps1 @@ -1,12 +1,87 @@ +# setup $ErrorActionPreference = "STOP" -# print welcome message +Import-Module WebAdministration + +function Wait-WebItemState +{ + param( + [ValidateNotNullOrEmpty()] + [string]$IISPath + , + [ValidateSet("Started", "Stopped")] + [string]$State + ) + + while ($true) + { + Write-Host "### Waiting on item '$IISPath' state to be '$State'..." + + try + { + $item = Get-Item -Path $IISPath + + if ($null -ne $item -and $item.State -ne $State) + { + if ($State -eq "Started") + { + $item = Start-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + elseif ($State -eq "Stopped") + { + $item = Stop-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + } + } + catch + { + $item = $null + } + + if ($null -ne $item -and $item.State -eq $State) + { + Write-Host "### Waiting on item '$IISPath' completed." + + break + } + + Start-Sleep -Milliseconds 500 + } +} + +# print start message Write-Host ("### Sitecore Production ENTRYPOINT, starting...") +# wait for w3wp to stop +while ($true) +{ + $processName = "w3wp" + + Write-Host "### Waiting for process '$processName' to stop..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -gt 0 + + if ($running) + { + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + } + else + { + Write-Host "### Process '$processName' stopped..." + + break; + } + + Start-Sleep -Milliseconds 500 +} + +# wait for application pool to stop +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Stopped" + # inject Sitecore config files Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" -# start servicemonitor.exe in background, kill foreground process if it fails +# start ServiceMonitor.exe in background, kill foreground process if it fails Start-Job -Name "ServiceMonitor.exe" { try { @@ -16,10 +91,30 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} | ForEach-Object { - Write-Host ("### Started '$($_.Name)'.") +} | Out-Null + +# wait for the ServiceMonitor.exe process is running +while ($true) +{ + $processName = "ServiceMonitor" + + Write-Host "### Waiting for process '$processName' to start..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -eq 1 + + if ($running) + { + Write-Host "### Process '$processName' started..." + + break; + } + + Start-Sleep -Milliseconds 500 } +# wait for application pool to start +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Started" + # print ready message Write-Host ("### Sitecore ready!") diff --git a/windows/tests/9.x.x/docker-compose.xm.yml b/windows/tests/9.x.x/docker-compose.xm.yml index 780d40c15..777901397 100644 --- a/windows/tests/9.x.x/docker-compose.xm.yml +++ b/windows/tests/9.x.x/docker-compose.xm.yml @@ -20,7 +20,7 @@ services: cd: image: ${REGISTRY}sitecore-xm-cd:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} - entrypoint: powershell.exe -NoLogo -File C:\\tools\\entrypoints\\iis\\Development.ps1 + entrypoint: powershell.exe -NoLogo -NoProfile -File C:\\tools\\entrypoints\\iis\\Development.ps1 environment: - "ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=true" - "ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=true" @@ -35,7 +35,7 @@ services: cm: image: ${REGISTRY}sitecore-xm-cm:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} - entrypoint: powershell.exe -NoLogo -File C:\\tools\\entrypoints\\iis\\Development.ps1 + entrypoint: powershell.exe -NoLogo -NoProfile -File C:\\tools\\entrypoints\\iis\\Development.ps1 environment: - "ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=false" - "ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=false" From 611df2007762e48d8e3dd00587474f677ad1cbd6 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Tue, 29 Oct 2019 08:39:51 +0100 Subject: [PATCH 14/18] updated entrypoints for 9.1.1 and 9.0.2 --- .../entrypoints/iis/Development.ps1 | 109 +++++++++++++++++- .../entrypoints/iis/EnableUdpLogging.config | 2 +- .../entrypoints/iis/Production.ps1 | 105 ++++++++++++++++- .../tools/entrypoints/iis/Development.ps1 | 109 +++++++++++++++++- .../entrypoints/iis/EnableUdpLogging.config | 2 +- .../tools/entrypoints/iis/Production.ps1 | 105 ++++++++++++++++- .../entrypoints/iis/EnableUdpLogging.config | 2 +- 7 files changed, 411 insertions(+), 23 deletions(-) diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 b/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 index 328216167..28afc93c0 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/Development.ps1 @@ -1,7 +1,84 @@ -# print welcome message +# setup +$ErrorActionPreference = "STOP" + +Import-Module WebAdministration + +function Wait-WebItemState +{ + param( + [ValidateNotNullOrEmpty()] + [string]$IISPath + , + [ValidateSet("Started", "Stopped")] + [string]$State + ) + + while ($true) + { + Write-Host "### Waiting on item '$IISPath' state to be '$State'..." + + try + { + $item = Get-Item -Path $IISPath + + if ($null -ne $item -and $item.State -ne $State) + { + if ($State -eq "Started") + { + $item = Start-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + elseif ($State -eq "Stopped") + { + $item = Stop-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + } + } + catch + { + $item = $null + } + + if ($null -ne $item -and $item.State -eq $State) + { + Write-Host "### Waiting on item '$IISPath' completed." + + break + } + + Start-Sleep -Milliseconds 500 + } +} + +# print start message Write-Host ("### Sitecore Development ENTRYPOINT, starting...") -# check to see if we should start the VS remote debugger +# wait for w3wp to stop +while ($true) +{ + $processName = "w3wp" + + Write-Host "### Waiting for process '$processName' to stop..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -gt 0 + + if ($running) + { + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + } + else + { + Write-Host "### Process '$processName' stopped..." + + break; + } + + Start-Sleep -Milliseconds 500 +} + +# wait for application pool to stop +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Stopped" + +# check to see if we should start the msvsmon.exe $useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true if ($useVsDebugger) @@ -16,7 +93,7 @@ else Write-Host ("### Skipping start of 'msvsmon.exe', to enable you should mount the Visual Studio Remote Debugger directory into 'C:\remote_debugger'.") } -# check to see if we should start the Watch-Directory script +# check to see if we should start the Watch-Directory.ps1 script $useWatchDirectory = (Test-Path -Path "C:\src" -PathType "Container") -eq $true if ($useWatchDirectory) @@ -45,7 +122,7 @@ else # inject Sitecore config files Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" -# start servicemonitor.exe in background, kill foreground process if it fails +# start ServiceMonitor.exe in background, kill foreground process if it fails Start-Job -Name "ServiceMonitor.exe" { try { @@ -55,10 +132,30 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} | ForEach-Object { - Write-Host ("### Started '$($_.Name)'.") +} | Out-Null + +# wait for the ServiceMonitor.exe process is running +while ($true) +{ + $processName = "ServiceMonitor" + + Write-Host "### Waiting for process '$processName' to start..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -eq 1 + + if ($running) + { + Write-Host "### Process '$processName' started..." + + break; + } + + Start-Sleep -Milliseconds 500 } +# wait for application pool to start +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Started" + # print ready message Write-Host ("### Sitecore ready!") diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config index df4cb5f34..47b1e66a9 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/EnableUdpLogging.config @@ -26,7 +26,7 @@ - + diff --git a/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 b/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 index d8d906926..7daaad66b 100644 --- a/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 +++ b/windows/9.0.2/sitecore-assets/entrypoints/iis/Production.ps1 @@ -1,10 +1,87 @@ -# print welcome message +# setup +$ErrorActionPreference = "STOP" + +Import-Module WebAdministration + +function Wait-WebItemState +{ + param( + [ValidateNotNullOrEmpty()] + [string]$IISPath + , + [ValidateSet("Started", "Stopped")] + [string]$State + ) + + while ($true) + { + Write-Host "### Waiting on item '$IISPath' state to be '$State'..." + + try + { + $item = Get-Item -Path $IISPath + + if ($null -ne $item -and $item.State -ne $State) + { + if ($State -eq "Started") + { + $item = Start-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + elseif ($State -eq "Stopped") + { + $item = Stop-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + } + } + catch + { + $item = $null + } + + if ($null -ne $item -and $item.State -eq $State) + { + Write-Host "### Waiting on item '$IISPath' completed." + + break + } + + Start-Sleep -Milliseconds 500 + } +} + +# print start message Write-Host ("### Sitecore Production ENTRYPOINT, starting...") +# wait for w3wp to stop +while ($true) +{ + $processName = "w3wp" + + Write-Host "### Waiting for process '$processName' to stop..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -gt 0 + + if ($running) + { + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + } + else + { + Write-Host "### Process '$processName' stopped..." + + break; + } + + Start-Sleep -Milliseconds 500 +} + +# wait for application pool to stop +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Stopped" + # inject Sitecore config files Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" -# start servicemonitor.exe in background, kill foreground process if it fails +# start ServiceMonitor.exe in background, kill foreground process if it fails Start-Job -Name "ServiceMonitor.exe" { try { @@ -14,10 +91,30 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} | ForEach-Object { - Write-Host ("### Started '$($_.Name)'.") +} | Out-Null + +# wait for the ServiceMonitor.exe process is running +while ($true) +{ + $processName = "ServiceMonitor" + + Write-Host "### Waiting for process '$processName' to start..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -eq 1 + + if ($running) + { + Write-Host "### Process '$processName' started..." + + break; + } + + Start-Sleep -Milliseconds 500 } +# wait for application pool to start +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Started" + # print ready message Write-Host ("### Sitecore ready!") diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 index 328216167..28afc93c0 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Development.ps1 @@ -1,7 +1,84 @@ -# print welcome message +# setup +$ErrorActionPreference = "STOP" + +Import-Module WebAdministration + +function Wait-WebItemState +{ + param( + [ValidateNotNullOrEmpty()] + [string]$IISPath + , + [ValidateSet("Started", "Stopped")] + [string]$State + ) + + while ($true) + { + Write-Host "### Waiting on item '$IISPath' state to be '$State'..." + + try + { + $item = Get-Item -Path $IISPath + + if ($null -ne $item -and $item.State -ne $State) + { + if ($State -eq "Started") + { + $item = Start-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + elseif ($State -eq "Stopped") + { + $item = Stop-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + } + } + catch + { + $item = $null + } + + if ($null -ne $item -and $item.State -eq $State) + { + Write-Host "### Waiting on item '$IISPath' completed." + + break + } + + Start-Sleep -Milliseconds 500 + } +} + +# print start message Write-Host ("### Sitecore Development ENTRYPOINT, starting...") -# check to see if we should start the VS remote debugger +# wait for w3wp to stop +while ($true) +{ + $processName = "w3wp" + + Write-Host "### Waiting for process '$processName' to stop..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -gt 0 + + if ($running) + { + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + } + else + { + Write-Host "### Process '$processName' stopped..." + + break; + } + + Start-Sleep -Milliseconds 500 +} + +# wait for application pool to stop +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Stopped" + +# check to see if we should start the msvsmon.exe $useVsDebugger = (Test-Path -Path "C:\remote_debugger\x64\msvsmon.exe" -PathType "Leaf") -eq $true if ($useVsDebugger) @@ -16,7 +93,7 @@ else Write-Host ("### Skipping start of 'msvsmon.exe', to enable you should mount the Visual Studio Remote Debugger directory into 'C:\remote_debugger'.") } -# check to see if we should start the Watch-Directory script +# check to see if we should start the Watch-Directory.ps1 script $useWatchDirectory = (Test-Path -Path "C:\src" -PathType "Container") -eq $true if ($useWatchDirectory) @@ -45,7 +122,7 @@ else # inject Sitecore config files Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" -# start servicemonitor.exe in background, kill foreground process if it fails +# start ServiceMonitor.exe in background, kill foreground process if it fails Start-Job -Name "ServiceMonitor.exe" { try { @@ -55,10 +132,30 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} | ForEach-Object { - Write-Host ("### Started '$($_.Name)'.") +} | Out-Null + +# wait for the ServiceMonitor.exe process is running +while ($true) +{ + $processName = "ServiceMonitor" + + Write-Host "### Waiting for process '$processName' to start..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -eq 1 + + if ($running) + { + Write-Host "### Process '$processName' started..." + + break; + } + + Start-Sleep -Milliseconds 500 } +# wait for application pool to start +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Started" + # print ready message Write-Host ("### Sitecore ready!") diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index df4cb5f34..47b1e66a9 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -26,7 +26,7 @@ - + diff --git a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 index d8d906926..7daaad66b 100644 --- a/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 +++ b/windows/9.1.1/sitecore-assets/tools/entrypoints/iis/Production.ps1 @@ -1,10 +1,87 @@ -# print welcome message +# setup +$ErrorActionPreference = "STOP" + +Import-Module WebAdministration + +function Wait-WebItemState +{ + param( + [ValidateNotNullOrEmpty()] + [string]$IISPath + , + [ValidateSet("Started", "Stopped")] + [string]$State + ) + + while ($true) + { + Write-Host "### Waiting on item '$IISPath' state to be '$State'..." + + try + { + $item = Get-Item -Path $IISPath + + if ($null -ne $item -and $item.State -ne $State) + { + if ($State -eq "Started") + { + $item = Start-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + elseif ($State -eq "Stopped") + { + $item = Stop-WebItem -PSPath $IISPath -Passthru -ErrorAction "SilentlyContinue" + } + } + } + catch + { + $item = $null + } + + if ($null -ne $item -and $item.State -eq $State) + { + Write-Host "### Waiting on item '$IISPath' completed." + + break + } + + Start-Sleep -Milliseconds 500 + } +} + +# print start message Write-Host ("### Sitecore Production ENTRYPOINT, starting...") +# wait for w3wp to stop +while ($true) +{ + $processName = "w3wp" + + Write-Host "### Waiting for process '$processName' to stop..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -gt 0 + + if ($running) + { + Stop-Process -Name $processName -Force -ErrorAction "SilentlyContinue" + } + else + { + Write-Host "### Process '$processName' stopped..." + + break; + } + + Start-Sleep -Milliseconds 500 +} + +# wait for application pool to stop +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Stopped" + # inject Sitecore config files Copy-Item -Path (Join-Path $PSScriptRoot "\*.config") -Destination "C:\inetpub\wwwroot\App_Config\Include" -# start servicemonitor.exe in background, kill foreground process if it fails +# start ServiceMonitor.exe in background, kill foreground process if it fails Start-Job -Name "ServiceMonitor.exe" { try { @@ -14,10 +91,30 @@ Start-Job -Name "ServiceMonitor.exe" { { Get-Process -Name "filebeat" | Stop-Process -Force } -} | ForEach-Object { - Write-Host ("### Started '$($_.Name)'.") +} | Out-Null + +# wait for the ServiceMonitor.exe process is running +while ($true) +{ + $processName = "ServiceMonitor" + + Write-Host "### Waiting for process '$processName' to start..." + + $running = [array](Get-Process -Name $processName -ErrorAction "SilentlyContinue").Length -eq 1 + + if ($running) + { + Write-Host "### Process '$processName' started..." + + break; + } + + Start-Sleep -Milliseconds 500 } +# wait for application pool to start +Wait-WebItemState -IISPath "IIS:\AppPools\DefaultAppPool" -State "Started" + # print ready message Write-Host ("### Sitecore ready!") diff --git a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config index df4cb5f34..47b1e66a9 100644 --- a/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config +++ b/windows/9.2.0/sitecore-assets/tools/entrypoints/iis/EnableUdpLogging.config @@ -26,7 +26,7 @@ - + From 0ef2aea6c6f1110bd8547d3f0bc0ad838d7c015e Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Tue, 29 Oct 2019 08:56:28 +0100 Subject: [PATCH 15/18] updated docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce5dffc36..90230a7e6 100644 --- a/README.md +++ b/README.md @@ -145,9 +145,9 @@ Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in - Starts `ServiceMonitor.exe` in the background. - Starts `filebeat.exe` in the foreground and outputting to `STDOUT`. - FileBeat inputs configured: - - IIS access logs, **disabled** by default, can be enable with environment variable: `ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=true` - - IIS error logs, **disabled** by default, enable with environment variable: `ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=true` - - Sitecore logs, **enabled** by default, enable with environment variable: `ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=true` + - IIS access logs, **disabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=true` + - IIS error logs, **disabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=true` + - Sitecore logs, **enabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=true` `C:\tools\entrypoints\iis\Development.ps1` features: From 18355bae31770755c2882c84141df989af1cf8af Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Thu, 31 Oct 2019 11:03:23 +0100 Subject: [PATCH 16/18] moved to november release --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3142f0e7..e5096b217 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ # Changelog +## November 2019 + +- [Added] New **optional** `ENTRYPOINT` scripts (log streaming, auto start watch and auto start remote debugger) for IIS based images. See [README.md](/README.md#optional-entrypoint-scripts) on how to use. + ## October 2019 -- [Added] New **optional** `ENTRYPOINT` scripts for IIS based images. See [README.md](/README.md#optional-entrypoint-scripts) for how to use. - [Added] Sitecore 9.2.0 XC images. -- [Added] New 9.2.0 `xp-xconnect-processingengine` images. See [#84](https://github.com/Sitecore/docker-images/issues/43). Thanks [@adoprog](https://github.com/adoprog) :+1: +- [Added] New 9.2.0 `xp-xconnect-processingengine` images. See [#43](https://github.com/Sitecore/docker-images/issues/43). Thanks [@adoprog](https://github.com/adoprog) :+1: - [Changed] Windows and Linux `spe` "Sitecore PowerShell Extensions" images updated to **v6.0**, indirectly *also* updating all `sxa` images. See [#84](https://github.com/Sitecore/docker-images/issues/84). Thanks [@michaellwest](https://github.com/michaellwest) :+1: - [Changed] The `c:\tools\scripts\Watch-Directory.ps1` no longer deletes destination directories, only files. See [#89](https://github.com/Sitecore/docker-images/issues/89). Thanks [@sshushliapin](https://github.com/sshushliapin) :+1: - [Fixed] The `c:\tools` folder was empty. From a59bd43c4defaa8f1cf6011d77b18301a400a995 Mon Sep 17 00:00:00 2001 From: Per Manniche Bering Date: Thu, 31 Oct 2019 15:14:03 +0100 Subject: [PATCH 17/18] updated docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 90230a7e6..16a4aebfb 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ Using these `ENTRYPOINT` scripts enables you to observe Sitecore log entries in - FileBeat inputs configured: - IIS access logs, **disabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_IIS_ACCESS_LOG_ENABLED=true` - IIS error logs, **disabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_IIS_ERROR_LOG_ENABLED=true` - - Sitecore logs, **enabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=true` + - Sitecore logs, **enabled** by default, can be switched using environment variable: `ENTRYPOINT_STDOUT_SITECORE_LOG_ENABLED=false` `C:\tools\entrypoints\iis\Development.ps1` features: From afe4f8071f12f2d1ad30541c98242be59d457f69 Mon Sep 17 00:00:00 2001 From: Peter N Date: Thu, 14 Nov 2019 19:36:35 +0100 Subject: [PATCH 18/18] #126 Fixed Hardcoded `- C:\license:C:\license`. Replaced with ` - ${LICENSE_PATH}:C:\license`. (#127) --- windows/tests/9.x.x/docker-compose.xp.spe.yml | 6 +++--- windows/tests/9.x.x/docker-compose.xp.sxa.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/windows/tests/9.x.x/docker-compose.xp.spe.yml b/windows/tests/9.x.x/docker-compose.xp.spe.yml index 24becbc15..44ace95b4 100644 --- a/windows/tests/9.x.x/docker-compose.xp.spe.yml +++ b/windows/tests/9.x.x/docker-compose.xp.spe.yml @@ -21,7 +21,7 @@ services: xconnect: image: ${REGISTRY}sitecore-xp-xconnect:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - - C:\license:C:\license + - ${LICENSE_PATH}:C:\license - .\data\xconnect:C:\inetpub\wwwroot\App_Data\logs mem_limit: 1GB links: @@ -31,7 +31,7 @@ services: xconnect-automationengine: image: ${REGISTRY}sitecore-xp-xconnect-automationengine:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - - C:\license:C:\license + - ${LICENSE_PATH}:C:\license - .\data\xconnect-automationengine:C:\AutomationEngine\App_Data\logs mem_limit: 500MB links: @@ -41,7 +41,7 @@ services: xconnect-indexworker: image: ${REGISTRY}sitecore-xp-xconnect-indexworker:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - - C:\license:C:\license + - ${LICENSE_PATH}:C:\license - .\data\xconnect-indexworker:C:\IndexWorker\App_Data\logs mem_limit: 500MB links: diff --git a/windows/tests/9.x.x/docker-compose.xp.sxa.yml b/windows/tests/9.x.x/docker-compose.xp.sxa.yml index 91e16e241..8166f138b 100644 --- a/windows/tests/9.x.x/docker-compose.xp.sxa.yml +++ b/windows/tests/9.x.x/docker-compose.xp.sxa.yml @@ -21,7 +21,7 @@ services: xconnect: image: ${REGISTRY}sitecore-xp-xconnect:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - - C:\license:C:\license + - ${LICENSE_PATH}:C:\license - .\data\xconnect:C:\inetpub\wwwroot\App_Data\logs mem_limit: 1GB links: @@ -31,7 +31,7 @@ services: xconnect-automationengine: image: ${REGISTRY}sitecore-xp-xconnect-automationengine:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - - C:\license:C:\license + - ${LICENSE_PATH}:C:\license - .\data\xconnect-automationengine:C:\AutomationEngine\App_Data\logs mem_limit: 500MB links: @@ -41,7 +41,7 @@ services: xconnect-indexworker: image: ${REGISTRY}sitecore-xp-xconnect-indexworker:${SITECORE_VERSION}-windowsservercore-${WINDOWSSERVERCORE_VERSION} volumes: - - C:\license:C:\license + - ${LICENSE_PATH}:C:\license - .\data\xconnect-indexworker:C:\IndexWorker\App_Data\logs mem_limit: 500MB links: