Skip to content

Commit

Permalink
ggg
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed Apr 26, 2024
1 parent da52522 commit 51bd160
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .gitlab/pipeline/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ build:windows:
- Start-Service -Name "docker"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build --tag foo -f Dockerfile.windows .
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build
--pull
--tag foo
-f Dockerfile.windows
.
- docker push foo
after_script:
- docker logout $CI_REGISTRY
Expand Down
25 changes: 15 additions & 10 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["powershell", "-Command"]

RUN $env:starter_path = Get-Location
SHELL ["powershell.exe", "-Command"]

# 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 "--quiet", "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \
"--add", "Microsoft.VisualStudio.Workload.VCTools", "--includeRecommended" -Wait
RUN $env:starter_path = Get-Location; \
Invoke-WebRequest "https://aka.ms/vs/17/release/vs_buildtools.exe" \
-OutFile "$env:TEMP\vs_buildtools.exe" -UseBasicParsing; \
Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" \
-ArgumentList "--wait", "--nocache", "--norestart", "--noUpdateInstaller", \
"--add", "Microsoft.VisualStudio.Workload.VCTools" -Wait

# install vcpkg
RUN $env:VCPKG_INSTALL_DIR = "c:\\vcpkg"
RUN $env:VCPKG_DEFAULT_TRIPLET="x64-windows"
RUN $env:VCPKG_INSTALL_DIR = "c:\\vcpkg"; \
$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 && \
Expand All @@ -22,3 +21,9 @@ RUN git clone https://github.com/microsoft/vcpkg $env:VCPKG_INSTALL_DIR && \
# 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"]

0 comments on commit 51bd160

Please sign in to comment.