agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Justin Pryzby <[email protected]>
Subject: [PATCH 6/7] cirrus: upload changed html docs as artifacts
Date: Sat, 26 Feb 2022 19:39:10 -0600
Always run doc build; to allow them to be shown in cfbot, they should not be
skipped if the linux build fails.
This could be done on the client side (cfbot). One advantage of doing it here
is that fewer docs are uploaded - many patches won't upload docs at all.
https://cirrus-ci.com/task/5396696388599808
ci-os-only: html
---
.cirrus.yml | 18 ++++++++++++++++--
src/tools/ci/copy-changed-docs | 16 ++++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
create mode 100755 src/tools/ci/copy-changed-docs
diff --git a/.cirrus.yml b/.cirrus.yml
index 54ee1de4371..48e85b73649 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -589,7 +589,7 @@ task:
###
-# Verify docs can be built
+# Verify docs can be built, and (only on cfbot) upload changed docs as artifacts
###
task:
@@ -600,7 +600,7 @@ task:
BUILD_JOBS: 1
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(docs|html).*'
- #skip: "!changesInclude('.cirrus.yml', 'doc/**')"
+ #skip: "!changesInclude('.cirrus.yml', 'doc/**', 'src/tools/ci/copy-changed-docs')"
container:
image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
@@ -613,8 +613,22 @@ task:
cat /proc/cmdline
ulimit -a -H && ulimit -a -S
export
+ git diff --name-only "$BASE_COMMIT"
# Exercise HTML and other docs:
docs_build_script: |
time ./configure
make -s -j${BUILD_JOBS} -C doc
+ cp -r doc new-docs
+
+ # Build HTML docs from the base commit.
+ git checkout "$BASE_COMMIT" -- doc
+ make -s -C doc clean
+ make -s -C doc html
+ cp -r doc old-docs
+
+ copy_changed_docs_script: |
+ src/tools/ci/copy-changed-docs
+
+ 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
new file mode 100755
index 00000000000..0a942838f5c
--- /dev/null
+++ b/src/tools/ci/copy-changed-docs
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Copy HTML which differ into html_docs
+set -e
+
+outdir=html_docs
+
+mkdir "$outdir"
+cp new-docs/src/sgml/html/*.css new-docs/src/sgml/html/*.svg "$outdir/"
+
+changed=`git diff --no-index --name-only old-docs/src/sgml/html new-docs/src/sgml/html` ||
+ [ $? -eq 1 ]
+
+for f in $changed
+do
+ cp "$f" "$outdir"
+done
--
2.17.1
--wLAMOaPNJ0fu1fTG
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0007-f-html-index-file.patch"
view thread (17+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH 6/7] cirrus: upload changed html docs as artifacts
In-Reply-To: <no-message-id-137851@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox