X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Frtd-verify.sh;h=810a87cb0db4b04c4d05b1bfd55c489611017fd0;hb=2a10c83b2d506008cc6c01c134515fb6328e1f3a;hp=ff06358767ad21a5307314183e48be23b43d4403;hpb=1c6c45e731e8941f3ff7894641ca7aee77a80426;p=releng%2Fglobal-jjb.git diff --git a/shell/rtd-verify.sh b/shell/rtd-verify.sh index ff063587..810a87cb 100644 --- a/shell/rtd-verify.sh +++ b/shell/rtd-verify.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -11,17 +11,27 @@ echo "---> rtd-verify.sh" # Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail +# DO NOT set -u +set -xe -o pipefail echo "---> Fetching project" if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then + # Only test projects that are a submodule of docs + if ! git submodule | grep "$GERRIT_PROJECT"; then + echo "WARN: Project is not a submodule of docs. This likely means " \ + "the project is not participating in the monolithic docs build " \ + "and should have their own verify job. Quitting job run..." + exit 0 + fi + cd "docs/submodules/$GERRIT_PROJECT" fi git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD +git submodule update echo "---> Generating docs" +cd "$WORKSPACE" tox -edocs echo "---> Archiving generated docs"