From 98a7976b7358156411b1eda76bde7c3f4de7d008 Mon Sep 17 00:00:00 2001 From: Pallav Gupta Date: Thu, 20 May 2021 23:27:28 -0700 Subject: [PATCH] Fix validate-docs script Validate-docs script return exit 0 status even though airshipctl command fails in variable assignment with broken pipe. This make validate-docs zuul gate passes without complete script execution. In order to solve this issue added bash option 'set -o pipefail' which ensure return exit 0 if all commands in the pipeline exit successfully. Also minor change in echo statement which should print 'successful site valiation' only when particular phase evaluate not for skipped phases. Change-Id: I24db77e8054f4c7017d533b6640516f3141675fc --- tools/validate_docs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/validate_docs b/tools/validate_docs index 64524bd45..d1fb0d27c 100755 --- a/tools/validate_docs +++ b/tools/validate_docs @@ -15,6 +15,7 @@ # The makefile entrypoint driver for document validation # Expected to be run from the project root set -xe +set -o pipefail # The root of the manifest structure to be validated. # This corresponds to the targetPath in an airshipctl config @@ -83,8 +84,8 @@ for site_root in ${SITE_ROOTS}; do # TODO (raliev) remove this condition later if [ "$plan" = "phasePlan" ]; then airshipctl --airshipconf "${TMP}/$site.cfg" plan validate $plan + echo "Validation of site ${site} is successful!" fi - echo "Validation of site ${site} is successful!" done done done