X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Frtd-verify.sh;h=a1b1330c2255872a8d54c870cd4dfae1c05f2462;hb=b9eb4581940562effcf67863704a3ec2c47ceca0;hp=2074ecaf4e2aeb1fe0206fe8e6e520dda961f580;hpb=1dfa47374063e36176a5c26346cb7953d92c6618;p=releng%2Fglobal-jjb.git diff --git a/shell/rtd-verify.sh b/shell/rtd-verify.sh index 2074ecaf..a1b1330c 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,15 +11,34 @@ 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 + + +# When a new commands are added in lftools, the docs verify job needs to +# run the new command which requires installing the lftools dev version +if [[ $JOB_NAME == "lf-infra-lftools-rtd-verify-any" ]]; then + # shellcheck disable=SC1090 + source ~/lf-env.sh + lf-activate-venv pip + pip install -e . +fi echo "---> Generating docs" cd "$WORKSPACE"