add cleaning of sstate-cache to cleanup job
The gitlab runner for compliance pipeline is getting short of disk space. A strategy to handle that would be to purge sstate-cache from unused files.
The command to use is this one (part of oe-core)
https://git.yoctoproject.org/poky/plain/scripts/sstate-cache-management.sh
The option to use should be
--stamps-dir=<dir1>,<dir2>...<dirn>
Specify the build directory's stamps directories, the sstate
cache file which IS USED by these build diretories will be KEPT,
other sstate cache files in cache-dir will be removed. Use ","
as the separator. For example:
--stamps-dir=build1/tmp/stamps,build2/tmp/stamps
The way to generate the list for --stamps-dir
could be:
TO_KEEP=$(for i in /build/*/*/build-*/tmp/stamps; do echo -n $i,; done | sed -E 's/,$//')
oe-core/scripts/sstate-cache-management.sh --cache-dir=/build/common/sstate-cache --stamps-dir=$TO_KEEP --verbose --debug
The problem is that if two pipelines are running in parallel, the cleanup job of one pipeline may delete sstate-cache that is being created by the other pipeline... or maybe not?
Edited by Alberto Pianon