Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create playbook from antora-playbook.yml + a patch file #698

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

osfameron
Copy link
Collaborator

@osfameron osfameron commented Jun 8, 2023

Why

We maintain a bunch of playbooks locally, or for other environments, which eventually get out of sync with our main branch.
This means e.g. we forget to add new branches or extensions to Staging, or forget to update our ui-bundle locally etc.

When we have a local playbook that works, it's still a hassle to manually create the remote playbook for previewing.

Use Cases

  1. Turn a local playbook into a remote playbook (for previewing)
$ scripts/remotify my-playbook.yml
...
Composing antora-playbook.yml with my-playbook.remote.patch.yml
Written my-playbook.remote.yml
  1. Create a local file:
scripts/patch-playbook.mjs --patch patch.yml > local-playbook.yml
npx antora local-playbook.yml

See example patch.yml in this PR.
Operators like $filter, $prune, $local will cut down to certain repos, limit to a manageable number of branches, and turn the remote refs into local ones if you have them checked out.

  1. Create a staging playbook
scripts/patch-/playbook.mjs --patch patch-staging.yml > antora-playbook-staging.yml

This example again uses $prune to limit to the most recent X branches.
We can also $override individual repos, to add particular branches/start_paths etc. (e.g. for the devex private preview)

Simplified the logic by inverting it and creating the immutable tree
piece by piece, instead of mutating the existing playbook.

Added $seq to run multiple functions in pipeline.

Removed the git calls, as the HEAD branch handling didn't really work,
and required a bunch of messy async/await.
@osfameron osfameron requested review from ElliotFrancisHunter and removed request for leeming March 14, 2024 12:13
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.

1 participant