diff --git a/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.cfg b/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.cfg index fec134a03..cef91f4d2 100644 --- a/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.cfg +++ b/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.cfg @@ -1,14 +1,24 @@ # Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + env_vars: { key: "STAGING_BUCKET" value: "docs-staging" } +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2-staging" + # Production will be at: docs-staging-v2 +} + env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/{{ metadata['repo']['repo_short'] }}/.kokoro/release/publish_javadoc.sh" } + before_action { fetch_keystore { keystore_resource { diff --git a/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.sh b/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.sh index cf75d8dfa..918cf04fe 100755 --- a/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.sh +++ b/synthtool/gcp/templates/java_library/.kokoro/release/publish_javadoc.sh @@ -24,6 +24,11 @@ if [[ -z "${STAGING_BUCKET}" ]]; then exit 1 fi +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + # work from the git root directory pushd $(dirname "$0")/../../ @@ -31,13 +36,13 @@ pushd $(dirname "$0")/../../ python3 -m pip install gcp-docuploader # compile all packages -mvn clean install -B -DskipTests=true +mvn clean install -B -q -DskipTests=true NAME={{ metadata['repo']['distribution_name'].split(':')|last }} VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # build the docs -mvn site -B +mvn site -B -q pushd target/site/apidocs @@ -53,3 +58,19 @@ python3 -m docuploader upload . \ --staging-bucket ${STAGING_BUCKET} popd + +# V2 +mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" + +pushd target/devsite + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2}