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

[updoc] Check for errors while walking the filesystem #201

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions .github/workflows/provider-updoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ on:
default: '1.20'
required: false
type: string
updoc-version:
description: 'updoc version to use while publishing the documentation'
default: '21481764'
required: false
type: string
secrets:
UPBOUND_CI_PROD_BUCKET_SA:
required: true

env:
UPTEST_VERSION: "83bd901"

jobs:
publish-docs:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -78,7 +80,7 @@ jobs:
DOCS_DIR="./docs/family"
fi
echo "Publishing Docs for ${PROVIDER_PACKAGE_NAME}, ${{ env.VER_MAJOR_MINOR }} from $DOCS_DIR"
go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir="${DOCS_DIR}" --name="${PROVIDER_PACKAGE_NAME}" --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io
go run github.com/upbound/uptest/cmd/updoc@${{ inputs.updoc-version }} upload --docs-dir="${DOCS_DIR}" --name="${PROVIDER_PACKAGE_NAME}" --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io
done
else
echo "This job can only be run on release branches"
Expand Down
3 changes: 3 additions & 0 deletions internal/updoc/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ func (u *UploadManager) getIndex(afs afero.Fs, dir string, meta map[string]strin
func (u *UploadManager) getMeta(ctx context.Context, bucket *storage.BucketHandle, cdn string, afs afero.Fs, dir string) (map[string]string, error) {
meta := make(map[string]string)
if err := afero.Walk(afs, dir, func(p string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
if info.Name() == indexFN || info.Name() == sectionFN {
return nil
Expand Down
Loading