Commit 69947d58 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Ben Gamari

gitlab-ci: Cleanup Windows builds

See Note [Cleanup on Windows].
parent 2f07a97c
...@@ -11,6 +11,7 @@ stages: ...@@ -11,6 +11,7 @@ stages:
- lint - lint
- build - build
- full-build - full-build
- cleanup # See Note [Cleanup on Windows]
############################################################ ############################################################
# Runner Tags # Runner Tags
...@@ -368,6 +369,35 @@ validate-x86_64-windows: ...@@ -368,6 +369,35 @@ validate-x86_64-windows:
tags: tags:
- x86_64-windows - x86_64-windows
# Note [Cleanup on Windows]
# ~~~~~~~~~~~~~~~~~~~~~~~~~
#
# As noted in [1], gitlab-runner's shell executor doesn't clean up its working
# directory after builds. Unfortunately, we are forced to use the shell executor
# on Windows. To avoid running out of disk space we add a stage at the end of
# the build to remove the \GitLabRunner\builds directory. Since we only run a
# single build at a time on Windows this should be safe.
#
# [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
# See Note [Cleanup on Windows]
cleanup-windows:
stage: cleanup
tags:
- x86_64-windows
when: always
before_script:
- echo "Time to clean up"
script:
- echo "Let's go"
after_script:
- set "BUILD_DIR=%CI_PROJECT_DIR%"
- set "BUILD_DIR=%BUILD_DIR:/=\%"
- echo "Cleaning %BUILD_DIR%"
- cd \GitLabRunner
- rmdir /S /Q %BUILD_DIR%/*
- exit /b 0
############################################################ ############################################################
# Validation via CircleCI # Validation via CircleCI
############################################################ ############################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment