From 386c513428e0e11dd978e6423a3befbe76551eb9 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Fri, 26 Apr 2024 17:21:33 +0200 Subject: [PATCH] foo --- .gitlab/dockerfiles/Dockerfile.windows | 10 --------- .gitlab/pipeline/build-windows.yml | 11 +++++----- Dockerfile.windows | 30 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 15 deletions(-) delete mode 100644 .gitlab/dockerfiles/Dockerfile.windows create mode 100644 Dockerfile.windows diff --git a/.gitlab/dockerfiles/Dockerfile.windows b/.gitlab/dockerfiles/Dockerfile.windows deleted file mode 100644 index 064e5266..00000000 --- a/.gitlab/dockerfiles/Dockerfile.windows +++ /dev/null @@ -1,10 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2022 - -SHELL ["powershell", "-Command"] - -# download and install vs build tools needed by vcpkg -RUN Invoke-WebRequest "https://aka.ms/vs/17/release/vs_buildtools.exe" \ - -OutFile "%TEMP%\vs_buildtools.exe" -UseBasicParsing -RUN "%TEMP%\vs_buildtools.exe" --quiet --wait --norestart --noUpdateInstaller \ - --add Microsoft.VisualStudio.Workload.VCTools \ - --includeRecommended diff --git a/.gitlab/pipeline/build-windows.yml b/.gitlab/pipeline/build-windows.yml index fd4c6f22..f1d33f90 100644 --- a/.gitlab/pipeline/build-windows.yml +++ b/.gitlab/pipeline/build-windows.yml @@ -1,7 +1,7 @@ build:windows: stage: build tags: - - windows + - saas-windows-medium-amd64 rules: # on default branch - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH @@ -12,15 +12,16 @@ build:windows: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' when: manual before_script: + - Start-Service -Name "docker" - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: + - (docker pull $CI_REGISTRY_IMAGE:latest) -or (1 -eq 1) - docker build --pull - --cache-from $CI_REGISTRY_IMAGE:latest - --tag $CI_REGISTRY_IMAGE:windows_$CI_COMMIT_SHA - -f .gitlab/dockerfiles/Dockerfile.windows + --tag foo + -f Dockerfile.windows . - - docker push $CI_REGISTRY_IMAGE:windows_$CI_COMMIT_SHA + - docker push foo after_script: - docker logout $CI_REGISTRY diff --git a/Dockerfile.windows b/Dockerfile.windows new file mode 100644 index 00000000..75be258f --- /dev/null +++ b/Dockerfile.windows @@ -0,0 +1,30 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command"] + +RUN $env:starter_path = Get-Location + +# download and install vs build tools needed by vcpkg +RUN Invoke-WebRequest "https://aka.ms/vs/17/release/vs_buildtools.exe" \ + -OutFile "$env:TEMP\vs_buildtools.exe" -UseBasicParsing +RUN Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" \ + -ArgumentList "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \ + "--add", "Microsoft.VisualStudio.Workload.VCTools", "--includeRecommended" -Wait + +# install vcpkg +RUN $env:VCPKG_INSTALL_DIR = "c:\\vcpkg" +RUN $env:VCPKG_DEFAULT_TRIPLET="x64-windows" +RUN git clone https://github.com/microsoft/vcpkg $env:VCPKG_INSTALL_DIR && \ + cd $env:VCPKG_INSTALL_DIR && \ + bootstrap-vcpkg.bat -disableMetrics && \ + .\vcpkg install cgal boost-program-options boost-timer boost-test + +# build sfcgal +RUN cd $env:starter_path && \ + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSFCGAL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALL_DIR\scripts\buildsystems\vcpkg.cmake" + +# Restore default shell for Windows containers. +SHELL ["cmd.exe", "/s", "/c"] + +# Default to PowerShell if no other command specified. +CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]