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

Build all api docs on pull request #3296

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,20 @@ go build -o "${GOPATH}/bin/resourcedocsgen" .
popd

REGISTRY_COMMIT="$(git_sha_short)"
printf "Generating API docs from registry commit %s...\n\n" "${REGISTRY_COMMIT}"
resourcedocsgen docs registry --commitSha "${REGISTRY_COMMIT}" \
--baseDocsOutDir "themes/default/content/registry/packages" \
--basePackageTreeJSONOutDir "themes/default/static/registry/packages/navs" \
--logtostderr

printf "Running Hugo...\n\n"

case ${1} in
preview)
PKGS=(
"aiven"
"aws"
)

echo "Generating API docs for ${PKGS[*]}..."
echo ""

for PKG in "${PKGS[@]}" ; do \
resourcedocsgen docs registry "${PKG}" \
--commitSha "${REGISTRY_COMMIT}" \
--baseDocsOutDir "themes/default/content/registry/packages" \
--basePackageTreeJSONOutDir "themes/default/static/registry/packages/navs" \
--logtostderr
done
printf "Running Hugo...\n\n"
export HUGO_BASEURL="http://$(origin_bucket_prefix)-$(build_identifier).s3-website.$(aws_region).amazonaws.com"
GOGC=3 hugo --minify --buildFuture --templateMetrics -e preview
;;
update)
printf "Generating API docs from registry commit %s...\n\n" "${REGISTRY_COMMIT}"
resourcedocsgen docs registry --commitSha "${REGISTRY_COMMIT}" \
--baseDocsOutDir "themes/default/content/registry/packages" \
--basePackageTreeJSONOutDir "themes/default/static/registry/packages/navs" \
--logtostderr

printf "Running Hugo...\n\n"
GOGC=3 hugo --minify --buildFuture --templateMetrics -e production
;;
*)
Expand Down