mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 16:57:40 +03:00
faster disk cleanup check (#8565)
I can't reproduce the `chmod` failure and have no clue how to fix it, so for now let's just hope it's not too frequent. CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
fbea4e6ba8
commit
01f11109fa
@ -33,27 +33,19 @@ steps:
|
||||
# Location of the disk cache for CI servers set in their init files:
|
||||
# infra/macos/2-common-box/init.sh:echo "build:darwin --disk_cache=~/.bazel-cache" > ~/.bazelrc
|
||||
# infra/vsts_agent_linux_startup.sh:echo "build:linux --disk_cache=~/.bazel-cache" > ~/.bazelrc
|
||||
disk_cache=$HOME/.bazel-cache
|
||||
if [ $(du -ms "$disk_cache" | awk '{print $1}') -gt 80000 ]; then
|
||||
echo "Deleting '$disk_cache'..."
|
||||
if [ $(df -m . | sed 1d | awk '{print $4}') -lt 30000 ]; then
|
||||
echo "Disk full, cleaning up..."
|
||||
disk_cache="$HOME/.bazel-cache"
|
||||
rm -rf "$disk_cache"
|
||||
else
|
||||
echo "Disk cache small enough:"
|
||||
du -hs "$disk_cache"
|
||||
fi
|
||||
local_cache=$HOME/.cache/bazel
|
||||
if [ -d "$local_cache" ]; then
|
||||
if [ $(du -ms "$local_cache" | awk '{print $1}') -gt 80000 ]; then
|
||||
echo "Deleting '$local_cache'..."
|
||||
echo "removed '$disk_cache'"
|
||||
local_cache="$HOME/.cache/bazel"
|
||||
if [ -d "$local_cache" ]; then
|
||||
chmod -R +w "$local_cache"
|
||||
rm -rf "$local_cache"
|
||||
else
|
||||
echo "Local cache small enough:"
|
||||
du -hs "$local_cache"
|
||||
echo "removed '$local_cache'"
|
||||
fi
|
||||
else
|
||||
echo "No '$local_cache', moving on."
|
||||
fi
|
||||
df -h .
|
||||
displayName: clean-up disk cache
|
||||
|
||||
- bash: ./fmt.sh --test
|
||||
|
Loading…
Reference in New Issue
Block a user