project-config/jenkins/scripts/slave-cleanup.sh
Andreas Jaeger 16b7c693de Rework slave-cleanup
The current approach does not work at all: Every job runs "git clean" as
part of set up of workspace. So, the marker we use is deleted and all
the content as well.

So, what we can do is run the "git clean" also after a run, so that the
workspace is minimal between invocations and the initial "git clean"
becomes a nop. This helps with overall space on the proposal slave
since only the active job will use .tox directories etc. Since there's
no regular cleanup of workspace, this also helps when jobs get retired,
the workspace will continue to exist - but with the cleanup done, it's
much smaller.

Change-Id: I8b17724905634aa2f7cc657de073ee7cfe10f781
2016-04-13 06:35:13 +02:00

12 lines
342 B
Bash

#!/bin/bash -xe
# Cleanup workspace afterwards so that no extra files are in it.
# This is also done at beginning of each job but let's do it
# afterwards to save space on the workspace between invocations.
# Let's see how much we delete.
# Let du report sizes each directory.
du -h --max-depth=1 .
git clean -f -x -d
du -h --max-depth=1 .