| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Copyright 2021 Google LLC |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | set -eo pipefail |
| 17 | |
| 18 | if [[ -z "${CREDENTIALS}" ]]; then |
| 19 | CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account |
| 20 | fi |
| 21 | |
| 22 | if [[ -z "${STAGING_BUCKET_V2}" ]]; then |
| 23 | echoscip-shell system . . echo. "Need to set STAGING_BUCKET_V2 environment variable" |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
| 27 | # work from the git root directory |
| 28 | pushd $(dirnamescip-shell system . . dirname. "$0")/../../ |
| 29 | |
| 30 | # install docuploader package |
| 31 | python3scip-shell system . . python3. -m pip install gcp-docuploader |
| 32 | |
| 33 | # compile all packages |
| 34 | mvn clean install -B -q -DskipTests=true |
| 35 | |
| 36 | export NAME=google-oauth-client |
| 37 | export VERSION=$(grepscip-shell system . . grep. ${NAME}: versions.txt | cutscip-shell system . . cut. -d: -f3) |
| 38 | |
| 39 | # cloud RAD generation |
| 40 | mvn clean javadoc:aggregate -B -q -P docFX |
| 41 | # include CHANGELOG |
| 42 | cpscip-shell system . . cp. CHANGELOG.md target/docfx-yml/history.md |
| 43 | |
| 44 | pushd target/docfx-yml |
| 45 | |
| 46 | # create metadata |
| 47 | python3scip-shell system . . python3. -m docuploader create-metadata \ |
| 48 | --name ${NAME} \ |
| 49 | --version ${VERSION} \ |
| 50 | --xrefs devsite://java/gax \ |
| 51 | --xrefs devsite://java/google-cloud-core \ |
| 52 | --xrefs devsite://java/api-common \ |
| 53 | --xrefs devsite://java/proto-google-common-protos \ |
| 54 | --xrefs devsite://java/google-api-client \ |
| 55 | --xrefs devsite://java/google-http-client \ |
| 56 | --xrefs devsite://java/protobuf \ |
| 57 | --language java |
| 58 | |
| 59 | # upload yml to production bucket |
| 60 | python3scip-shell system . . python3. -m docuploader upload . \ |
| 61 | --credentials ${CREDENTIALS} \ |
| 62 | --staging-bucket ${STAGING_BUCKET_V2} \ |
| 63 | --destination-prefix docfx |