From: Justin Pryzby Date: Mon, 28 Feb 2022 23:18:19 -0600 Subject: [PATCH 20/21] f!html: index file This allows linking to the artifacts from the last successful build, which itself allows *not* rebuilding when sources haven't changed. ci/os/only: html --- .cirrus.yml | 4 ++-- src/tools/ci/copy-changed-docs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 53be4f6f4b6..2b7664485f6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -33,7 +33,7 @@ env: # And does the right thing for any 1-patch commits. # Patch series manually submitted to cirrus would benefit from setting this to the # number of patches in the series (or directly to the commit the series was rebased on). - BASE_COMMIT: HEAD~1 + BASE_COMMIT: HEAD~2 # What files to preserve in case tests fail @@ -694,7 +694,7 @@ task: cp -r doc old-docs copy_changed_docs_script: | - src/tools/ci/copy-changed-docs "old-docs" "new-docs" "html_docs" + src/tools/ci/copy-changed-docs "old-docs" "new-docs" "html_docs" "$CIRRUS_BRANCH" html_docs_artifacts: paths: ['html_docs/*.html', 'html_docs/*.png', 'html_docs/*.css'] diff --git a/src/tools/ci/copy-changed-docs b/src/tools/ci/copy-changed-docs index 1584f974d94..b0a4c971aaf 100755 --- a/src/tools/ci/copy-changed-docs +++ b/src/tools/ci/copy-changed-docs @@ -5,10 +5,16 @@ set -e old=$1 new=$2 outdir=$3 +branch=$4 mkdir "$outdir" cp "$new"/src/sgml/html/*.css "$new"/src/sgml/html/*.svg "$outdir" +# The index is useful to allow a static link to the artifacts for the most-recent, successful CI run for a branch +# https://api.cirrus-ci.com/v1/artifact/github/USERNAME/postgres/Documentation/html_docs/html_docs/00-doc.html?branch=BRANCH +index="$outdir/00-doc.html" +echo "Index of docs changed since: $branch" >>"$index" exit 0 -- 2.17.1 --mln0rGgUGuXEqmuI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0021-cirrus-run-freebsd-with-more-CPUs-RAM.patch"