Skip to content

Commit

Permalink
chore(internal/kokoro): fix doc upload (#8762)
Browse files Browse the repository at this point in the history
Python dependencies were removed to reduce the maintenance costs. The old `docuploader` tool didn't do anything fancy -- it just tarred the directory and uploaded it. See https://github.com/googleapis/docuploader/blob/0077f780e1bfaf0e0d7585d4a5cba5bc122f0ce9/docuploader/__main__.py#L69.
  • Loading branch information
tbpg authored Oct 24, 2023
1 parent f29683b commit 74fa783
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions internal/kokoro/publish_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cd github/google-cloud-go/internal/godocfx
go install -buildvcs=false
cd -

# Use the google-cloud-go service account to store godocfx state.
export GOOGLE_APPLICATION_CREDENTIALS=$KOKORO_KEYSTORE_DIR/72523_go_integration_service_account
# Keep GCLOUD_TESTS_GOLANG_PROJECT_ID in sync with continuous.sh.
export GCLOUD_TESTS_GOLANG_PROJECT_ID=dulcet-port-762
Expand All @@ -37,13 +38,21 @@ else
godocfx -project $GCLOUD_TESTS_GOLANG_PROJECT_ID -new-modules cloud.google.com/go google.golang.org/appengine
fi

# Use the docuploader service account to upload docs.
gcloud auth activate-service-account --key-file "$KOKORO_KEYSTORE_DIR/73713_docuploader_service_account"

for f in $(find obj/api -name docs.metadata); do
d=$(dirname $f)
cd $d
python3 -m docuploader upload \
--staging-bucket docs-staging-v2 \
--destination-prefix docfx \
--credentials "$KOKORO_KEYSTORE_DIR/73713_docuploader_service_account" \
# Extract the module and version from the docs.metadata file.
module=$(cat $d/docs.metadata | grep name | sed 's/.*"\(.*\)"/\1/')
version=$(cat $d/docs.metadata | grep version | sed 's/.*"\(.*\)"/\1/')
name="docfx-go-$module-$version.tar.gz"
mkdir -p $(dirname $name)
tar \
--create \
--directory=$d \
--file=$name \
--gzip \
.
cd -
gsutil cp $name gs://docs-staging-v2
done

0 comments on commit 74fa783

Please sign in to comment.