-#!/bin/bash
+#!/bin/bash -l
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
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
+
+if [[ $JOB_NAME == "lf-infra-lftools-rtd-verify-any" ]]; then
+ # Install patchset lftools
+ python3 -m pip install --user -e .
+fi
echo "---> Generating docs"
cd "$WORKSPACE"