mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
detect mount issue earlier (#10313)
When machine disks are full, we can't clean the Bazel cache if it happens to not be a mount point. I don't quite understand yet why it's not a mount point, but maybe I'll be able to investigate more if we catch the issue early, rather than waiting for the disk to be full and the clean-up to fail. CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
0e09f3ba08
commit
3c0010b38a
@ -10,6 +10,33 @@ steps:
|
||||
exec 1> >(while IFS= read -r line; do echo "$(date -uIs) [out]: $line"; done)
|
||||
exec 2> >(while IFS= read -r line; do echo "$(date -uIs) [err]: $line"; done >&2)
|
||||
|
||||
## START temp debug
|
||||
UNAME=$(uname)
|
||||
|
||||
case "$UNAME" in
|
||||
Darwin)
|
||||
MPS="/var/tmp/_bazel_vsts /Users/vsts/.bazel-cache"
|
||||
CMD="hdiutil info"
|
||||
;;
|
||||
Linux)
|
||||
MPS="/home/vsts/.cache/bazel /home/vsts/.bazel-cache"
|
||||
CMD="mount"
|
||||
;;
|
||||
*)
|
||||
echo "Unexpected uname: $UNAME"
|
||||
MPS=
|
||||
;;
|
||||
esac
|
||||
|
||||
for path in $MPS; do
|
||||
if ! ($CMD | grep -F "$path"); then
|
||||
echo "$path is not a mount point, aborting"
|
||||
echo "Please ping @gary on Slack."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
## END temp debug
|
||||
|
||||
df -h .
|
||||
if [ $(df -m . | sed 1d | awk '{print $4}') -lt 50000 ]; then
|
||||
echo "Disk full, cleaning up..."
|
||||
|
Loading…
Reference in New Issue
Block a user