From a439eaa66d90c774d1b4a3beb1722ddf1f42ffa0 Mon Sep 17 00:00:00 2001 From: Bryan Call Date: Tue, 4 Aug 2020 15:52:56 -0700 Subject: [PATCH 1/2] Skip docs builds if there are no changes in the doc dir --- ci/jenkins/bin/docs.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/jenkins/bin/docs.sh b/ci/jenkins/bin/docs.sh index 6aa2d92fcaa..0459b377e21 100755 --- a/ci/jenkins/bin/docs.sh +++ b/ci/jenkins/bin/docs.sh @@ -20,6 +20,15 @@ test -z "${ATS_MAKE}" && ATS_MAKE="make" test ! -z "${WORKSPACE}" && cd "${WORKSPACE}/src" +# Skip if nothing in doc has changed +if [ ! -z "$ghprbActualCommit" ]; then + git diff ${ghprbActualCommit}^...${ghprbActualCommit} --name-only | egrep -E '^doc/' > /dev/null + if [ $? = 1 ]; then + echo "No relevant files changed, skipping run" + exit 0 + fi +fi + # Run configure on the docs builds each time in case there have been updates autoreconf -fi && ./configure --enable-docs || exit 1 @@ -30,7 +39,7 @@ rm -rf docbuild/html ${ATS_MAKE} -e SPHINXOPTS="-D language='en'" html [ $? != 0 ] && exit 1 -# Only continue with the rsync and JA build if we're on the official docs updates. +# Only continue with the rsync and JA build if we're on the official docs updates [ -w /home/docs ] || exit 0 /usr/bin/rsync --delete -av docbuild/html/ /home/docs/en/${ATS_BRANCH} From 0b321da1c9024a4d93a1970e8849fe75cc08e179 Mon Sep 17 00:00:00 2001 From: Bryan Call Date: Mon, 10 Aug 2020 10:05:10 -0700 Subject: [PATCH 2/2] Check to see if the include files changed --- ci/jenkins/bin/docs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/jenkins/bin/docs.sh b/ci/jenkins/bin/docs.sh index 0459b377e21..5af6ae54f09 100755 --- a/ci/jenkins/bin/docs.sh +++ b/ci/jenkins/bin/docs.sh @@ -21,8 +21,10 @@ test -z "${ATS_MAKE}" && ATS_MAKE="make" test ! -z "${WORKSPACE}" && cd "${WORKSPACE}/src" # Skip if nothing in doc has changed +INCLUDE_FILES=$(for i in $(git grep literalinclude doc/ | awk '{print $3}'); do basename $i; done | sort -u | paste -sd\|) +echo $INCLUDE_FILES if [ ! -z "$ghprbActualCommit" ]; then - git diff ${ghprbActualCommit}^...${ghprbActualCommit} --name-only | egrep -E '^doc/' > /dev/null + git diff ${ghprbActualCommit}^...${ghprbActualCommit} --name-only | egrep -E "(^doc/|$INCLUDE_FILES)" > /dev/null if [ $? = 1 ]; then echo "No relevant files changed, skipping run" exit 0