-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'windows-dockerfile' into 'master'
ci: Build a windows docker image See merge request sfcgal/SFCGAL!311
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
build:windows: | ||
stage: build | ||
tags: | ||
- saas-windows-medium-amd64 | ||
rules: | ||
# on default branch | ||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH | ||
when: always | ||
# on a tag | ||
- if: $CI_COMMIT_TAG | ||
when: always | ||
# on a MR if previous jobs are successful | ||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' | ||
when: manual | ||
allow_failure: true | ||
before_script: | ||
- Start-Service -Name "docker" | ||
- docker login -u $env:CI_REGISTRY_USER -p $env:CI_REGISTRY_PASSWORD $env:CI_REGISTRY | ||
script: | ||
- (docker pull $env:CI_REGISTRY_IMAGE':'windows-latest) -or ($true) | ||
- docker build | ||
--pull | ||
--cache-from $env:CI_REGISTRY_IMAGE':'windows-latest | ||
--tag $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_SHA | ||
-f docker\Dockerfile.windows | ||
. | ||
- docker push $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_SHA | ||
after_script: | ||
- docker logout $env:CI_REGISTRY | ||
|
||
|
||
push:windows-latest: | ||
stage: deploy | ||
tags: | ||
- saas-windows-medium-amd64 | ||
only: | ||
refs: | ||
- master | ||
before_script: | ||
- Start-Service -Name "docker" | ||
- docker login -u $env:CI_REGISTRY_USER -p $env:CI_REGISTRY_PASSWORD $env:CI_REGISTRY | ||
script: | ||
- docker pull $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_SHA | ||
- docker tag $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_SHA $env:CI_REGISTRY_IMAGE':'windows-latest | ||
- docker push $env:CI_REGISTRY_IMAGE':'windows-latest | ||
after_script: | ||
- docker logout $env:CI_REGISTRY | ||
|
||
|
||
push:windows-tag: | ||
stage: deploy | ||
tags: | ||
- saas-windows-medium-amd64 | ||
only: | ||
refs: | ||
- tags | ||
before_script: | ||
- Start-Service -Name "docker" | ||
- docker login -u $env:CI_REGISTRY_USER -p $env:CI_REGISTRY_PASSWORD $env:CI_REGISTRY | ||
script: | ||
- docker pull $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_SHA | ||
- docker tag $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_SHA $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_REF_NAME | ||
- docker push $env:CI_REGISTRY_IMAGE':'windows-$env:CI_COMMIT_REF_NAME | ||
after_script: | ||
- docker logout $env:CI_REGISTRY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Use sfcgal dependencies images | ||
FROM sfcgal/sfcgal-build-deps:windows-latest | ||
|
||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
WORKDIR "c:\SFCGAL" | ||
COPY . ./ | ||
|
||
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 | ||
|
||
# Restore the default Windows shell for correct batch processing. | ||
SHELL ["cmd", "/S", "/C"] | ||
|
||
ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] |