Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .kokoro-autosynth/build-in-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file is a copy of build.sh with edits to work correctly inside trampoline.

  • bazel installation is omitted since that already exists in the Docker image gcr.io/gapic-images/googleapis
  • nvm installation is omitted since it is only needed by NodeJS

# Copyright 2021 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

# Use synthtool templates at this commit hash
export SYNTHTOOL_TEMPLATES="`pwd`/synthtool/gcp/templates"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Add github to known hosts.
mkdir "$HOME/.ssh"
ssh-keyscan github.com >> "$HOME/.ssh/known_hosts"

# Kokoro exposes this as a file, but the scripts expect just a plain variable.
export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key)

# Setup git credentials
echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials
git config --global credential.helper 'store --file ~/.git-credentials'

python3 -m venv env
source env/bin/activate
python3 -m pip install --upgrade --quiet -r requirements.txt
export PYTHONPATH=`pwd`
python3 -m autosynth.multi --config ${MULTISYNTH_CONFIG}
15 changes: 14 additions & 1 deletion .kokoro-autosynth/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,18 @@ env_vars: {
value: "[email protected]"
}

# Env vars for trampoline
# https://github.com/googlecloudplatform/docker-ci-helper
# Trampoline is currently only used by PHP and Python jobs.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/gapic-images/googleapis:20210423"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: ".kokoro-autosynth/build-in-docker.sh"
}

# Bump the default timeout up to 5 hours.
timeout_mins: 300
timeout_mins: 300
2 changes: 2 additions & 0 deletions .kokoro-autosynth/php.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.php"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard3.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard4.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard5.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard6.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard7.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard8.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
2 changes: 2 additions & 0 deletions .kokoro-autosynth/python-shard9.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build_file: "synthtool/.kokoro-autosynth/trampoline_v2.sh"

env_vars: {
key: "MULTISYNTH_CONFIG"
value: "autosynth.providers.python"
Expand Down
Loading