From 3c91a6529b73cbf30f097d0f9860e441b7ddf8f6 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Fri, 14 Jun 2019 16:03:17 -0400 Subject: [PATCH] Add Linkage Monitor presubmit check (#719) * Linkage Monitor * 2019 * empty commit to trigger Kokoro * 755 permission --- .kokoro/linkage-monitor.sh | 34 +++++++++++++++++++++++++++ .kokoro/presubmit/linkage-monitor.cfg | 15 ++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 .kokoro/linkage-monitor.sh create mode 100644 .kokoro/presubmit/linkage-monitor.cfg diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 000000000..c7ad10cc3 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2019 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 + +cd github/google-http-java-client/ + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# Installs snapshot artifacts locally. Linkage Monitor uses them. +mvn install -DskipTests=true -B -V + +# 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/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 000000000..b8e1a21e1 --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,15 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Linkage Monitor notifies new linkage errors as Kokoro presubmit check +# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/google-http-java-client/.kokoro/linkage-monitor.sh" +}