From: Justin Pryzby Date: Mon, 28 Feb 2022 23:18:19 -0600 Subject: [PATCH 10/10] +html index file This allows linking to the artifacts from the last successful build, which itself allows *not* rebuilding when sources haven't changed. //freebsd //-os-only: html, --- .cirrus.yml | 2 +- src/tools/ci/copy-changed-docs | 42 ++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 338c6c2be16..5e1612b583e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -773,7 +773,7 @@ task: task: name: Documentation only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(docs|html).*' - #skip: "!changesInclude('.cirrus.yml', 'doc/**', 'src/tools/ci/copy-changed-docs')" + skip: "!changesInclude('.cirrus.yml', 'doc/**', 'src/tools/ci/copy-changed-docs')" env: CPUS: 2 diff --git a/src/tools/ci/copy-changed-docs b/src/tools/ci/copy-changed-docs index 598e639f695..c60428e1ae1 100755 --- a/src/tools/ci/copy-changed-docs +++ b/src/tools/ci/copy-changed-docs @@ -5,6 +5,10 @@ set -e old=$1 new=$2 outdir=$3 +branch=$CIRRUS_BRANCH + +# The index is large and changes often +skippages="bookindex.html" # The index is large and changes often skippages="bookindex.html" @@ -13,6 +17,19 @@ mkdir "$outdir" cp doc/src/sgml/*.css "$outdir" cp doc/src/sgml/images/*.svg "$outdir" +# The index is useful to allow a static link (not specific to a cirrus run) to the artifacts for the most-recent, successful CI run for a branch +branchurl=https://api.cirrus-ci.com/v1/artifact/github/$CIRRUS_REPO_FULL_NAME/$CIRRUS_TASK_NAME/html_docs/html_docs/00-index.html?branch=$branch + +index="$outdir/00-index.html" +cat >"$index" < +Index of docs changed since: $BASE_COMMIT + + +

Index of docs changed since: $BASE_COMMIT

+