Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed May 13, 2024
1 parent 1551d93 commit 46b4acb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
11 changes: 6 additions & 5 deletions .gitlab/pipeline/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ build:windows:
when: manual
before_script:
- Start-Service -Name "docker"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker login -u $env:CI_REGISTRY_USER -p $env:CI_REGISTRY_PASSWORD $env:CI_REGISTRY
script:
- (docker pull $CI_REGISTRY_IMAGE:latest) -or (1 -eq 1)
- (docker pull $env:CI_REGISTRY_IMAGE:latest) -or (1 -eq 1)
- docker build
--pull
--tag foo
--cache-from $env:CI_REGISTRY_IMAGE:latest
--tag $env:CI_REGISTRY_IMAGE:$env:CI_COMMIT_SHA
-f Dockerfile.windows
.
- docker push foo
- docker push $env:CI_REGISTRY_IMAGE:$env:CI_COMMIT_SHA
after_script:
- docker logout $CI_REGISTRY
- docker logout $env:CI_REGISTRY


44 changes: 11 additions & 33 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,37 +1,15 @@
# Use the latest Windows Server Core 2022 image.
FROM mcr.microsoft.com/windows/servercore:ltsc2022
# Use sfcgal dependencies images
FROM sfcgal/sfcgal-build-deps:windows-latest

# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

# Download the Build Tools bootstrapper.
RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe

RUN DIR
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# # Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
# RUN vs_buildtools.exe --quiet --wait --norestart --nocache \
# --installPath "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools" \
# --add Microsoft.VisualStudio.Workload.VCTools \
# --includeRecommended \
# || IF "%ERRORLEVEL%"=="3010" EXIT 0 \
# # Cleanup
# && del /q vs_buildtools.exe
RUN cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DSFCGAL_BUILD_TESTS=OFF \
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake"; \
cmake --build build --config Release

RUN curl -SL --output git.zip https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/MinGit-2.41.0.3-64-bit.zip \
&& mkdir "%ProgramFiles%\Git" \
&& powershell -command "Expand-Archive -Path C:\git.zip -DestinationPath '%ProgramFiles%\git'" \
&& powershell -command "(Get-Content 'C:/Program Files/Git/etc/gitconfig') -replace 'path = C:/Program Files/Git/etc/gitconfig', '' | Set-Content 'C:/Program Files/Git/etc/gitconfig'" \
&& del /q git.zip \
&& SETX /M PATH "%ProgramFiles%\Git\cmd;%ProgramFiles%\Git\mingw64\bin;%ProgramFiles%\Git\usr\bin;%PATH%

RUN git clone https://github.com/microsoft/vcpkg.git C:\vcpkg \
&& cd vcpkg \
&& bootstrap-vcpkg.bat \
&& SETX /M PATH "C:\vcpkg;%PATH%" \
&& vcpkg install zlib:x64-windows --clean-after-build \
&& vcpkg remove zlib:x64-windows
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

# Define the entry point for the docker container.
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\\Program Files\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

0 comments on commit 46b4acb

Please sign in to comment.