daml/ci/clean-up.yml
Gary Verhaegen d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00

58 lines
1.4 KiB
YAML

# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
steps:
- bash: |
set -euo pipefail
eval "$(dev-env/bin/dade-assist)"
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, forcing cache reset"
$HOME/reset_caches.sh
echo "Done."
fi
done
## END temp debug
df -h .
if [ $(df -m . | sed 1d | awk '{print $4}') -lt 80000 ]; then
echo "Disk full, cleaning up..."
$HOME/reset_caches.sh
echo "Done."
df -h .
fi
## More temp debugging
for path in $MPS; do
if ! ($CMD | grep -F "$path"); then
echo "$path is not a mount point, forcing cache reset"
$HOME/reset_caches.sh
echo "Done."
fi
done
## End more debugging
displayName: clean-up disk cache