From b164c23661f276610aa483e16adaf98fa7ff409e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0t=C4=9Bp=C3=A1nek?= Date: Fri, 7 May 2021 05:57:13 +0200 Subject: [PATCH] Configure CI (no. 98) --- Dockerfile | 22 +++++++++++++++++----- ci/windows/BuildLocal.ps1 | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa582df968..c6066e04fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,26 @@ # escape=` FROM mcr.microsoft.com/dotnet/sdk:3.1 as dotnet-installer + +# export fonts from full-windows (based on https://stackoverflow.com/a/65655141) +FROM mcr.microsoft.com/windows:20H2 as full-windows +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +RUN Copy-Item -Path C:\Windows\Fonts -Exclude lucon.ttf -Destination C:\tmp\fonts -Recurse; ` + New-Item -ItemType Directory -Force -Path C:\tmp\registries; ` + reg export 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' C:\tmp\registries\Fonts.reg; ` + reg export 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink' C:\tmp\registries\FontLink.reg; + + FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 -RUN Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') +# import fonts from full-windows +COPY --from=full-windows /tmp/fonts/ /Windows/Fonts/ +COPY --from=full-windows /tmp/registries/ /tmp/registries/ +RUN reg import C:\tmp\registries\Fonts.reg; reg import C:\tmp\registries\FontLink.reg; -RUN scoop config shim kiennq +RUN Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1') -RUN scoop install git; ` - scoop bucket add extras; ` - scoop install googlechrome chromedriver +RUN choco install -y googlechrome chromedriver COPY --from=dotnet-installer ["/Program Files/dotnet", "/Program Files/dotnet"] @@ -19,5 +30,6 @@ RUN dotnet help ENTRYPOINT [] + COPY artifacts/DotVVM.Samples.BasicSamples.Owin /inetpub/dotvvm.owin COPY src/DotVVM.Samples.Common /inetpub/DotVVM.Samples.Common diff --git a/ci/windows/BuildLocal.ps1 b/ci/windows/BuildLocal.ps1 index 03c5f9dd10..df60fef5ec 100644 --- a/ci/windows/BuildLocal.ps1 +++ b/ci/windows/BuildLocal.ps1 @@ -1,7 +1,7 @@ $root = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot ..\..)) $env:DOTVVM_ROOT = $root -git clean -dfx $root\src +git clean -dfx $root -e .vscode cd $root\src\DotVVM.Framework ` && npm ci ` && npm run build `