From 767bb00c2979ea51b236771917676d1f38ce8ad1 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 16 May 2019 10:33:20 -0700 Subject: [PATCH] build: adding kokoro config for release-please (#101) --- .kokoro/release-candidate-issue.sh | 25 +++++++++++++++++++++ .kokoro/release-github.sh | 24 ++++++++++++++++++++ .kokoro/release-requested.sh | 25 +++++++++++++++++++++ .kokoro/release/common.cfg | 8 +++++++ .kokoro/release/publish.cfg | 9 -------- .kokoro/release/release-candidate-issue.cfg | 22 ++++++++++++++++++ .kokoro/release/release-github.cfg | 22 ++++++++++++++++++ .kokoro/release/release-requested.cfg | 22 ++++++++++++++++++ 8 files changed, 148 insertions(+), 9 deletions(-) create mode 100755 .kokoro/release-candidate-issue.sh create mode 100755 .kokoro/release-github.sh create mode 100755 .kokoro/release-requested.sh create mode 100644 .kokoro/release/common.cfg create mode 100644 .kokoro/release/release-candidate-issue.cfg create mode 100644 .kokoro/release/release-github.cfg create mode 100644 .kokoro/release/release-requested.cfg diff --git a/.kokoro/release-candidate-issue.sh b/.kokoro/release-candidate-issue.sh new file mode 100755 index 000000000..e520bb7ca --- /dev/null +++ b/.kokoro/release-candidate-issue.sh @@ -0,0 +1,25 @@ +#!/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 +# +# https://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 + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key) + +npx release-please candidate-issue --token=$GITHUB_TOKEN \ + --repo-url=googleapis/release-please \ + --package-name=release-please diff --git a/.kokoro/release-github.sh b/.kokoro/release-github.sh new file mode 100755 index 000000000..29960ae3d --- /dev/null +++ b/.kokoro/release-github.sh @@ -0,0 +1,24 @@ +#!/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 +# +# https://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 + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key) + +npx release-please github-release --token=$GITHUB_TOKEN \ + --repo-url=googleapis/release-please diff --git a/.kokoro/release-requested.sh b/.kokoro/release-requested.sh new file mode 100755 index 000000000..5a4aa3800 --- /dev/null +++ b/.kokoro/release-requested.sh @@ -0,0 +1,25 @@ +#!/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 +# +# https://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 + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key) + +npx release-please detect-checked --token=$GITHUB_TOKEN \ + --repo-url=googleapis/release-please \ + --package-name=release-please diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 000000000..3ba2eb095 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,8 @@ +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} diff --git a/.kokoro/release/publish.cfg b/.kokoro/release/publish.cfg index 41a4a5bda..4ac3c1a59 100644 --- a/.kokoro/release/publish.cfg +++ b/.kokoro/release/publish.cfg @@ -9,15 +9,6 @@ before_action { } } -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - } - } -} - before_action { fetch_keystore { keystore_resource { diff --git a/.kokoro/release/release-candidate-issue.cfg b/.kokoro/release/release-candidate-issue.cfg new file mode 100644 index 000000000..82b979212 --- /dev/null +++ b/.kokoro/release/release-candidate-issue.cfg @@ -0,0 +1,22 @@ +# 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: "release-please/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/release-please/.kokoro/release-candidate-issue.sh" +} diff --git a/.kokoro/release/release-github.cfg b/.kokoro/release/release-github.cfg new file mode 100644 index 000000000..f6a2f24cc --- /dev/null +++ b/.kokoro/release/release-github.cfg @@ -0,0 +1,22 @@ +# 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: "release-please/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/release-please/.kokoro/release-github.sh" +} diff --git a/.kokoro/release/release-requested.cfg b/.kokoro/release/release-requested.cfg new file mode 100644 index 000000000..0e02223d9 --- /dev/null +++ b/.kokoro/release/release-requested.cfg @@ -0,0 +1,22 @@ +# 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: "release-please/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/release-please/.kokoro/release-requested.sh" +}