|
| 1 | +#!/bin/bash |
| 2 | +# Copyright 2021 Google Inc. |
| 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 | + echo "Need to set STAGING_BUCKET_V2 environment variable" |
| 24 | + exit 1 |
| 25 | +fi |
| 26 | + |
| 27 | +# work from the git root directory |
| 28 | +pushd $(dirname "$0")/../../ |
| 29 | + |
| 30 | +# install docuploader package |
| 31 | +python3 -m pip install gcp-docuploader |
| 32 | + |
| 33 | +# compile all packages |
| 34 | +mvn clean install -B -q -DskipTests=true |
| 35 | + |
| 36 | +export NAME=google-cloud-secretmanager |
| 37 | +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) |
| 38 | + |
| 39 | +# V3 generates docfx yml from javadoc |
| 40 | +# generate yml |
| 41 | +mvn clean site -B -q -P docFX |
| 42 | + |
| 43 | +pushd target/docfx-yml |
| 44 | + |
| 45 | +# create metadata |
| 46 | +python3 -m docuploader create-metadata \ |
| 47 | + --name ${NAME} \ |
| 48 | + --version ${VERSION} \ |
| 49 | + --language java |
| 50 | + |
| 51 | +# upload yml |
| 52 | +python3 -m docuploader upload . \ |
| 53 | + --credentials ${CREDENTIALS} \ |
| 54 | + --staging-bucket ${STAGING_BUCKET_V2} \ |
| 55 | + --destination-prefix docfx- |
0 commit comments