From 35bdfa87a020b504649bbf64687622ad4380ae63 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Tue, 22 Nov 2022 08:06:56 -0700 Subject: [PATCH] do full sync when Antora reverts to running a full build (#12263) --- .github/actions/publish-docs.sh | 4 ++++ lib/antora/extensions/autoconfig-partial-build.js | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/publish-docs.sh b/.github/actions/publish-docs.sh index 7db8dffb05..5593d26c00 100755 --- a/.github/actions/publish-docs.sh +++ b/.github/actions/publish-docs.sh @@ -19,6 +19,10 @@ fi echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVATE_KEY_PATH" echo "$SSH_KNOWN_HOST" > ~/.ssh/known_hosts RSYNC_OPTS='-avz --delete' + if [ -f .full-build ]; then + unlink .full-build + BUILD_REFNAME= + fi if [ -n "$BUILD_REFNAME" ]; then RSYNC_OPTS="-c $RSYNC_OPTS$(find $FROM -mindepth 1 -maxdepth 1 \! -name 404.html \! -name '.*' -type f -printf ' --include /%P')" RSYNC_OPTS="$RSYNC_OPTS$(find $FROM -mindepth 1 -maxdepth 1 -type d \! -name _ -printf ' --include /%P --include /%P/**') --exclude **" diff --git a/lib/antora/extensions/autoconfig-partial-build.js b/lib/antora/extensions/autoconfig-partial-build.js index a0641492fd..b81d32bdcf 100644 --- a/lib/antora/extensions/autoconfig-partial-build.js +++ b/lib/antora/extensions/autoconfig-partial-build.js @@ -1,7 +1,8 @@ 'use strict' const execFile = require('node:util').promisify(require('node:child_process').execFile) -const { promises: fsp } = require('node:fs') +const fsp = require('node:fs/promises') +const ospath = require('node:path') module.exports.register = function () { if (!process.env.BUILD_REFNAME) return @@ -26,7 +27,8 @@ module.exports.register = function () { const versionsInManifest = siteManifestData.components.ROOT.versions if (!(version in versionsInManifest && isBranch === !!versionsInManifest[version].prerelease)) { const category = require('path').basename(module.id, '.js') - this.getLogger(category).info(`version ${version} not previously built; reverting to full build`) + await fsp.writeFile(ospath.join(playbook.dir, '.full-build'), '') + console.log(`version ${version} not previously built; reverting to full build`) return } Object.assign(