From ce5fc365240d2748b98ccffb11722a8c8956a7d1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Jun 2021 19:26:33 +0000 Subject: [PATCH] chore(nodejs): use cloud-rad publication process (#1112) (#327) VERSION is used in @google-cloud/cloud-rad to publish ref docs for a particular version. Pass VERSION in via Stubby or Fusion. Source-Link: https://github.com/googleapis/synthtool/commit/740366bbb9a7e0f4b77fc75dc26be1d3a376c3e0 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:bbdd52de226c00df3356cdf25460397b429ab49552becca645adbc412f6a4ed5 --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release/docs-devsite.cfg | 2 +- .kokoro/release/docs-devsite.sh | 48 ++------------------------------ .trampolinerc | 3 +- 4 files changed, 7 insertions(+), 48 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 3a93af9..f6467c3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-nodejs:latest - digest: sha256:14aaee566d6fc07716bb92da416195156e47a4777e7d1cd2bb3e28c46fe30fe2 + digest: sha256:bbdd52de226c00df3356cdf25460397b429ab49552becca645adbc412f6a4ed5 diff --git a/.kokoro/release/docs-devsite.cfg b/.kokoro/release/docs-devsite.cfg index 6aa4a5d..f912c4c 100644 --- a/.kokoro/release/docs-devsite.cfg +++ b/.kokoro/release/docs-devsite.cfg @@ -11,7 +11,7 @@ before_action { # doc publications use a Python image. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } # Download trampoline resources. diff --git a/.kokoro/release/docs-devsite.sh b/.kokoro/release/docs-devsite.sh index 7657be3..2198e67 100755 --- a/.kokoro/release/docs-devsite.sh +++ b/.kokoro/release/docs-devsite.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ set -eo pipefail -# build jsdocs (Python is installed on the Node 10 docker image). if [[ -z "$CREDENTIALS" ]]; then # if CREDENTIALS are explicitly set, assume we're testing locally # and don't set NPM_CONFIG_PREFIX. @@ -25,47 +24,6 @@ if [[ -z "$CREDENTIALS" ]]; then cd $(dirname $0)/../.. fi -mkdir ./etc - npm install -npm run api-extractor -npm run api-documenter - -npm i json@9.0.6 -g -NAME=$(cat .repo-metadata.json | json name) - -mkdir ./_devsite -cp ./yaml/$NAME/* ./_devsite - -# Clean up TOC -# Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 -sed -i -e '1,3d' ./yaml/toc.yml -sed -i -e 's/^ //' ./yaml/toc.yml -# Delete interfaces from TOC (name and uid) -sed -i -e '/name: I[A-Z]/{N;d;}' ./yaml/toc.yml -sed -i -e '/^ *\@google-cloud.*:interface/d' ./yaml/toc.yml - -cp ./yaml/toc.yml ./_devsite/toc.yml - -# create docs.metadata, based on package.json and .repo-metadata.json. -pip install -U pip -python3 -m pip install --user gcp-docuploader -python3 -m docuploader create-metadata \ - --name=$NAME \ - --version=$(cat package.json | json version) \ - --language=$(cat .repo-metadata.json | json language) \ - --distribution-name=$(cat .repo-metadata.json | json distribution_name) \ - --product-page=$(cat .repo-metadata.json | json product_documentation) \ - --github-repository=$(cat .repo-metadata.json | json repo) \ - --issue-tracker=$(cat .repo-metadata.json | json issue_tracker) -cp docs.metadata ./_devsite/docs.metadata - -# deploy the docs. -if [[ -z "$CREDENTIALS" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi -if [[ -z "$BUCKET" ]]; then - BUCKET=docs-staging-v2 -fi - -python3 -m docuploader upload ./_devsite --destination-prefix docfx --credentials $CREDENTIALS --staging-bucket $BUCKET +npm install --no-save @google-cloud/cloud-rad@^0.2.5 +npx @google-cloud/cloud-rad \ No newline at end of file diff --git a/.trampolinerc b/.trampolinerc index 164613b..d4fcb89 100644 --- a/.trampolinerc +++ b/.trampolinerc @@ -20,7 +20,8 @@ required_envvars+=( # Add env vars which are passed down into the container here. pass_down_envvars+=( - "AUTORELEASE_PR" + "AUTORELEASE_PR", + "VERSION" ) # Prevent unintentional override on the default image.