summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-01-21 10:55:48 -0500
committerBen Gamari <ben@smart-cactus.org>2019-01-24 16:12:11 -0500
commit2eb5e1471d94d4b733995e433532d5c5f9871432 (patch)
treee3a1741977dc48a85154e4dfc7e9029a349ce7ff
parent886ddb27bfbbb52c41690cd29e2ab3ed80bf5450 (diff)
downloadhaskell-wip/cleanup-darwin.tar.gz
gitlab-ci: Use build cleanup logic on Darwin as wellwip/cleanup-darwin
We use the shell executor on Darwin as well as Windows. See https://gitlab.com/gitlab-org/gitlab-runner/issues/3856.
-rw-r--r--.gitlab-ci.yml24
1 files changed, 21 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d739effaba..e7d25fbd20 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -380,8 +380,8 @@ validate-x86_64-windows:
- ghc.tar.xz
- junit.xml
-# Note [Cleanup on Windows]
-# ~~~~~~~~~~~~~~~~~~~~~~~~~
+# Note [Cleaning up after shell executor]
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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
@@ -391,7 +391,7 @@ validate-x86_64-windows:
#
# [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
-# See Note [Cleanup on Windows]
+# See Note [Cleanup after shell executor]
cleanup-windows:
stage: cleanup
tags:
@@ -409,3 +409,21 @@ cleanup-windows:
- cd \GitLabRunner
- rmdir /S /Q %BUILD_DIR%/*
- exit /b 0
+
+# See Note [Cleanup after shell executor]
+cleanup-darwin:
+ stage: cleanup
+ tags:
+ - x86_64-darwin
+ when: always
+ before_script:
+ - echo "Time to clean up"
+ script:
+ - echo "Let's go"
+ after_script:
+ - BUILD_DIR=$CI_PROJECT_DIR
+ - echo "Cleaning $BUILD_DIR"
+ - cd $HOME
+ - rm -Rf $BUILD_DIR/*
+ - exit 0
+