With this change, the work done for local development, and the per-PR netlify preview changes:
It will no longer include the website stuff for versions other than edge, the current working tree.
We thus save us the time, and the flakiness, involved with
- checking if github has release binaries for all the versions
- checking out their sources
- fetching the release binaries to pre-hydrate old versions' live-blocks.
The previously-used, documented make target should still be intact.
Fixes#4379 to some extent, I hope.
* docs/website: remove "latest" binary from opa versions cache
Having a stale binary here -- one called "latest" but not actually
being "latest" -- causes issues like this: when building the website
content for the (real) latest version, the script would take the
old (previous-latest) binary, and fail because that binary didn't
know the latest future keywords.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
With this change, we should get both a /docs/v0.36.1 and a /docs/latest
in our deployed docs.
Before, the symlink would have made hugo only build a /docs/latest,
but not the other link.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
The website deployment takes longer than it has to because we're
checking for binaries we don't really care about: those predating
the website, and those of release candidates.
Now, we'll only curl for those we don't skip.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
* website/scripts/load-docs.sh: less verbose output
1. Less output: the tag semver ordering isn't something we work
on daily, so let's silence that.
2. Use 'git archive' and tar, not a checkout:
this way, we don't mess up the working directory or reflog. It
should also be faster, since we don't end up writing all the
vendor files, binary blobs, etc to disk.
3. Make the 'latest' symlink relative.
* scripts/live-blocks/inject: run preprocess with max allowed args
Before, when attempting to do this, I had used
find ... -exec npm run preprocess {} +
and find had determined what the maximum number of allowed command
line args were, and executed that call in batches of those. `npm`,
however, would have prepended the call with its own args, thereby
exceeding the limit.
As a way out, we had used `xargs -n200`, to preprocess the files
in batches of 200 at a time.
Now, we're telling `find` the exact command needed, bypassing the
package.json helper definition.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Any release tag with a `rc` string in the the semver
will be ignored for the docs on the website and will _not_ update the
"latest" docker image tag, or "latest" downloads url.
Signed-off-by: Patrick East <east.patrick@gmail.com>
Instead of using url rewriting tricks we will just copy the latest
docs as part of the build process for a "latest" version.
In the version selector code we need to handle this to hide the
version, but overall it simplifies the template code.. so thats nice.
Best part, and main reason for doing this, is that the pretty url
feature will now work on the `/docs/latest/*` urls. It will fix some
weirdness with the relative url links we use in the markdown content
and remove a duplicate search result.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This lets us simplify some of the code and there isn't really a great
reason to keep the older docs up at this point.
Signed-off-by: Patrick East <east.patrick@gmail.com>
If there was a tag and branch that both referenced HEAD it would
return to the tag instead of branch. This change gives priority to
the branch if the current HEAD corresponds to one.
Signed-off-by: Patrick East <east.patrick@gmail.com>
We were using a file with hard coded versions to display docs for, but
this complicates things if/when we need to do patch releases on
different branches from master.
Signed-off-by: Patrick East <east.patrick@gmail.com>