From 62303c19ee5c62dd884d90a4c3390190a3bcc17a Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Tue, 14 Aug 2018 15:01:21 -0700 Subject: [PATCH 1/2] Add Kokoro CI config --- .kokoro/build.sh | 28 ++++++++++++++++++++++++++++ .kokoro/common.cfg | 13 +++++++++++++ .kokoro/presubmit/common.cfg | 24 ++++++++++++++++++++++++ .kokoro/presubmit/java10.cfg | 7 +++++++ .kokoro/presubmit/java7.cfg | 7 +++++++ .kokoro/presubmit/java8.cfg | 7 +++++++ .kokoro/presubmit/java9.cfg | 7 +++++++ .kokoro/trampoline.sh | 24 ++++++++++++++++++++++++ 8 files changed, 117 insertions(+) create mode 100755 .kokoro/build.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/java10.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/java9.cfg create mode 100644 .kokoro/trampoline.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 000000000..30ca16719 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright 2018 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 + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json + +mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V +mvn test -B diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 000000000..6687c6bde --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "google-http-java-client/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/google-http-java-client/.kokoro/build.sh" +} diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 000000000..582175deb --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "google-http-java-client/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/google-http-java-client/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/presubmit/java10.cfg b/.kokoro/presubmit/java10.cfg new file mode 100644 index 000000000..e560ae22f --- /dev/null +++ b/.kokoro/presubmit/java10.cfg @@ -0,0 +1,7 @@ +# 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/java10" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 000000000..584e8ea60 --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# 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/java7" +} diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000..34f6c33e5 --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,7 @@ +# 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" +} diff --git a/.kokoro/presubmit/java9.cfg b/.kokoro/presubmit/java9.cfg new file mode 100644 index 000000000..650dfc693 --- /dev/null +++ b/.kokoro/presubmit/java9.cfg @@ -0,0 +1,7 @@ +# 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/java9" +} diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 000000000..ba17ce014 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2018 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 +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" From 90c1804df9d326f600689b3a43a4cd19286d7336 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 23 Aug 2018 15:15:33 -0700 Subject: [PATCH 2/2] Application credentials are not necessary --- .kokoro/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 30ca16719..54392a85e 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -21,8 +21,5 @@ cd github/google-http-java-client/ java -version echo $JOB_TYPE -# Setup service account credentials. -export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V mvn test -B