ignore nix/clean.sh failures when in CI

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-08-22 10:19:53 -04:00
parent 2e06dd36da
commit 2b34900a9b
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 10 additions and 2 deletions

View File

@ -6,8 +6,16 @@ set -e
function cleanup() {
# clear trapped signals
trap - EXIT ERR INT QUIT
# do the actual cleanup
./nix/clean.sh "${nixResultPath}"
# do the actual cleanup, ignore failure
if ./nix/clean.sh "${nixResultPath}"; then
echo "Successful cleanup!"
elif [[ -n "${JENKINS_URL}" ]]; then
# in CI removing some paths can fail due to parallel builds
echo "Ignoring cleanup failure in CI."
else
echo "Failed cleanup!"
exit 1
fi
}
trap cleanup EXIT ERR INT QUIT