diff --git a/java-resourcemanager/.github/workflows/ci.yaml b/java-resourcemanager/.github/workflows/ci.yaml index 683022075665..98a472e132d6 100644 --- a/java-resourcemanager/.github/workflows/ci.yaml +++ b/java-resourcemanager/.github/workflows/ci.yaml @@ -54,7 +54,18 @@ jobs: with: java-version: 8 - run: java -version - - run: .kokoro/linkage-monitor.sh + - name: Install artifacts to local Maven repository + run: | + source .kokoro/common.sh + retry_with_backoff 3 10 \ + mvn install -B -V \ + -Dmaven.test.skip -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + shell: bash + - uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/java-resourcemanager/.kokoro/linkage-monitor.sh b/java-resourcemanager/.kokoro/linkage-monitor.sh deleted file mode 100755 index 759ab4e2c220..000000000000 --- a/java-resourcemanager/.kokoro/linkage-monitor.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -# Display commands being run. -set -x - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java version -java -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true - -# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR -JAR=linkage-monitor-latest-all-deps.jar -curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" - -# Fails if there's new linkage errors compared with baseline -java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/java-resourcemanager/.kokoro/release/publish_javadoc.cfg b/java-resourcemanager/.kokoro/release/publish_javadoc.cfg index f2add1698ab4..c72671f8ba7f 100644 --- a/java-resourcemanager/.kokoro/release/publish_javadoc.cfg +++ b/java-resourcemanager/.kokoro/release/publish_javadoc.cfg @@ -26,7 +26,4 @@ before_action { keyname: "docuploader_service_account" } } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" \ No newline at end of file +} \ No newline at end of file diff --git a/java-resourcemanager/.kokoro/release/publish_javadoc11.cfg b/java-resourcemanager/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 000000000000..2ddd71ce63ec --- /dev/null +++ b/java-resourcemanager/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" + # Production will be at: docs-staging-v2 +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-memcache/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" \ No newline at end of file diff --git a/java-resourcemanager/.kokoro/release/publish_javadoc11.sh b/java-resourcemanager/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 000000000000..648d99aa216b --- /dev/null +++ b/java-resourcemanager/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +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")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-resourcemanager +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload yml +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx- diff --git a/java-resourcemanager/synth.metadata b/java-resourcemanager/synth.metadata index 473c130757d6..67b6f698e1d4 100644 --- a/java-resourcemanager/synth.metadata +++ b/java-resourcemanager/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-resourcemanager.git", - "sha": "4bdc56a51398070542a46f2f827852270ea705c4" + "sha": "0950e825836c5dd270f1f749b5427b36808b0939" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3816b080296d4d52975079fd26c110dd26ba25af" + "sha": "e935c9ecb47da0f2e054f5f1845f7cf7c95fa625" } } ], @@ -40,7 +40,6 @@ ".kokoro/continuous/java8.cfg", ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", - ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", @@ -72,6 +71,8 @@ ".kokoro/release/promote.sh", ".kokoro/release/publish_javadoc.cfg", ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/publish_javadoc11.cfg", + ".kokoro/release/publish_javadoc11.sh", ".kokoro/release/snapshot.cfg", ".kokoro/release/snapshot.sh", ".kokoro/release/stage.cfg",