Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .kokoro/client-library-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash
# Copyright 2020 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.

# Presubmit to ensure the dependencies of the Google Libraries BOM, with the modification of change
# in the PR, pick up the highest versions among transitive dependencies.
# https://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html

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}/..

# Print out tool version
echo $JOB_TYPE
java -version
mvn -version
git version

# Make artifacts available for 'mvn validate' at the bottom
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V

# The version property tag of this BOM in the client library
VERSION_KEY=google.cloud.shared-dependencies.version
# Read the current version of this BOM in the POM. Example version: '0.116.1-alpha-SNAPSHOT'
VERSION_POM=pom.xml
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
VERSION=`sed -e 's/xmlns=".*"//' $VERSION_POM | xmllint --xpath '/project/version/text()' -`

if [ -z "${VERSION}" ]; then
echo "Version is not found in ${VERSION_POM}"
exit 1
fi
echo "Version: ${VERSION}"

# Check this BOM against a few java client libraries
# java-bigquery
git clone https://github.com/googleapis/java-bigquery.git
cd java-bigquery
mvn install
cd google-cloud-bigquery
mvn validate -D${VERSION_KEY}=${VERSION}

# java-bigqueryconnection
git clone https://github.com/googleapis/java-bigqueryconnection.git
cd java-bigqueryconnection
mvn install
cd google-cloud-bigqueryconnection
mvn validate -D${VERSION_KEY}=${VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to run all the tests? or just run the dependencies tests?


# java-storage
git clone https://github.com/googleapis/java-storage.git
cd java-storage
mvn install
cd google-cloud-storage
mvn validate -D${VERSION_KEY}=${VERSION}

# java-spanner
git clone https://github.com/googleapis/java-spanner.git
cd java-spanner
mvn install
cd google-cloud-spanner
mvn validate -D${VERSION_KEY}=${VERSION}
12 changes: 12 additions & 0 deletions .kokoro/presubmit/client-library-check.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Format: //devtools/kokoro/config/proto/build.proto

# 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/java-shared-dependencies/.kokoro/client-library-check.sh"
}