Skip to content

fetch-docs: allow REPO/REPO_ID/NAME overrides from the environment - #3

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:ci/fetch-docs-env
Open

fetch-docs: allow REPO/REPO_ID/NAME overrides from the environment#3
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:ci/fetch-docs-env

Conversation

@grandixximo

@grandixximo grandixximo commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Make the three source constants overridable from the environment. Defaults are unchanged, so existing cron lines behave as before.

Reason: LinuxCNC/doc-search CI builds linuxcnc-doc-search.tar.gz, the plain docs artifact plus an in-browser pagefind search box (via the topbar slot from LinuxCNC/linuxcnc#4184). It rebuilds only when the docs digest changes, so there is no artifact churn. The trust model is unchanged: head_repository_id pin, sha256 check, tree checks. The webserver token needs nothing new; doc-search is a public repo.

@andypugh: searchable devel docs go live by editing the existing master cron line (a second line on the same webroot would fight it):

FETCH_DOCS_REPO=LinuxCNC/doc-search FETCH_DOCS_REPO_ID=1275651762 \
FETCH_DOCS_NAME=linuxcnc-doc-search.tar.gz \
fetch-docs master /var/www/.../docs/devel

Keep the old line commented for rollback. 2.9 stays on the plain artifact; its pages predate the topbar slot.

Defaults are unchanged, so existing cron lines keep publishing the plain
linuxcnc-doc artifact. Overriding the three values lets the same script
publish a post-processed variant, such as the searchable docs built by
LinuxCNC/doc-search, with the same trust checks (head_repository_id pin,
sha256, tree sanity).
@andypugh

andypugh commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Sorry, but I need a bit more help than this.
The above looks nothing like the existing crontab.

0 * * * * /home/emcboard/fetch-docs 2.9 /home/emcboard/www.linuxcnc.org/docs/stable/ 0 * * * * /home/emcboard/fetch-docs master /home/emcboard/www.linuxcnc.org/docs/devel/

(it doesn't help that crontab -e uses a unique editor that I don't know, JOE)

@grandixximo

Copy link
Copy Markdown
Contributor Author

Thanks, that is exactly what I needed. Here is the line in your crontab's shape, one line, no continuations:

0 * * * * FETCH_DOCS_REPO=LinuxCNC/doc-search FETCH_DOCS_REPO_ID=1275651762 FETCH_DOCS_NAME=linuxcnc-doc-search.tar.gz /home/emcboard/fetch-docs master /home/emcboard/www.linuxcnc.org/docs/devel/

It replaces the existing devel line; keep the old one commented above it so rollback is just swapping back.

Two things to know:

  • This only takes effect once this PR is merged and you copy the updated fetch-docs over the one at /home/emcboard/fetch-docs. With the script that is there now, the env vars are silently ignored and it keeps publishing the plain docs, so nothing breaks if the line goes in early.
  • The hourly cadence is fine. A new searchable artifact appears at most every 6 hours, and only when the docs actually changed, so most runs are no-ops via the stamp file.

For JOE: make the edit, then Ctrl+K followed by X saves and exits; Ctrl+C aborts without saving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants