From b34f619e1c85810dcb3c578107d2e48ba4ee2b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Fri, 17 Mar 2023 10:56:16 +0100 Subject: [PATCH] kokoro: always chown files after build --- kokoro/linux-clang-gn/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kokoro/linux-clang-gn/build.sh b/kokoro/linux-clang-gn/build.sh index 563432a1..111f5294 100755 --- a/kokoro/linux-clang-gn/build.sh +++ b/kokoro/linux-clang-gn/build.sh @@ -38,6 +38,7 @@ set -e # Fail on any error. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )" ROOT_DIR="$( cd "${SCRIPT_DIR}/../.." >/dev/null 2>&1 && pwd )" +set +e # Allow build failure docker run --rm -i \ --volume "${ROOT_DIR}:${ROOT_DIR}" \ --workdir "${ROOT_DIR}" \ @@ -46,4 +47,9 @@ docker run --rm -i \ --entrypoint "${SCRIPT_DIR}/build-docker.sh" \ "gcr.io/shaderc-build/radial-build:latest" +# This is important. If the permissions are not fixed, kokoro will fail +# to pull build artifacts, and put the build in tool-failure state, which +# blocks the logs. +RESULT=$? sudo chown -R "$(id -u):$(id -g)" "${ROOT_DIR}" +exit $RESULT