mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
24 lines
922 B
YAML
24 lines
922 B
YAML
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||
|
# SPDX-License-Identifier: Apache-2.0
|
||
|
|
||
|
steps:
|
||
|
- bash: |
|
||
|
set -euo pipefail
|
||
|
# 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
|
||
|
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"
|
||
|
echo "removed '$disk_cache'"
|
||
|
local_cache="$HOME/.cache/bazel"
|
||
|
if [ -d "$local_cache" ]; then
|
||
|
chmod -R +w "$local_cache"
|
||
|
rm -rf "$local_cache"
|
||
|
echo "removed '$local_cache'"
|
||
|
fi
|
||
|
fi
|
||
|
df -h .
|
||
|
displayName: clean-up disk cache
|