Skip to content

Commit 74fa783

Browse files
authored
chore(internal/kokoro): fix doc upload (#8762)
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://togithub.com/googleapis/docuploader/blob/0077f780e1bfaf0e0d7585d4a5cba5bc122f0ce9/docuploader/__main__.py#L69.
1 parent f29683b commit 74fa783

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

internal/kokoro/publish_docs.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ cd github/google-cloud-go/internal/godocfx
2323
go install -buildvcs=false
2424
cd -
2525

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

41+
# Use the docuploader service account to upload docs.
42+
gcloud auth activate-service-account --key-file "$KOKORO_KEYSTORE_DIR/73713_docuploader_service_account"
43+
4044
for f in $(find obj/api -name docs.metadata); do
4145
d=$(dirname $f)
42-
cd $d
43-
python3 -m docuploader upload \
44-
--staging-bucket docs-staging-v2 \
45-
--destination-prefix docfx \
46-
--credentials "$KOKORO_KEYSTORE_DIR/73713_docuploader_service_account" \
46+
# Extract the module and version from the docs.metadata file.
47+
module=$(cat $d/docs.metadata | grep name | sed 's/.*"\(.*\)"/\1/')
48+
version=$(cat $d/docs.metadata | grep version | sed 's/.*"\(.*\)"/\1/')
49+
name="docfx-go-$module-$version.tar.gz"
50+
mkdir -p $(dirname $name)
51+
tar \
52+
--create \
53+
--directory=$d \
54+
--file=$name \
55+
--gzip \
4756
.
48-
cd -
57+
gsutil cp $name gs://docs-staging-v2
4958
done

0 commit comments

Comments
 (0)