-
Notifications
You must be signed in to change notification settings - Fork 31
chore: fix release build #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
213a09f
chore: fix release build
busunkim96 b2867a1
fix: fix config names
busunkim96 b6c746f
chore: add populate secrets script
busunkim96 a191fdd
docs: fix license
busunkim96 8e7c83a
chore: preserve original year
busunkim96 15245af
chore: revert years in manually committed files
busunkim96 aeb6718
🦉 Updates from OwlBot
gcf-owl-bot[bot] e92acae
chore: update lockfile
busunkim96 8600e00
Merge branch 'update-kokoro-configs' of github.com:googleapis/python-…
busunkim96 3eba298
chore: add .kokoro/docker directory
busunkim96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file or at | ||
# https://developers.google.com/open-source/licenses/bsd | ||
|
||
docker: | ||
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest | ||
digest: sha256:82d046d572a11b84d64d4b9af93ad55a1b6a4854917504ba7557acdfce907dde |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file or at | ||
# https://developers.google.com/open-source/licenses/bsd | ||
|
||
docker: | ||
image: gcr.io/repo-automation-bots/owlbot-python:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ before_action { | |
keyname: "docuploader_service_account" | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# Copyright 2020 Google LLC | ||
# | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file or at | ||
# https://developers.google.com/open-source/licenses/bsd | ||
|
||
set -eo pipefail | ||
|
||
function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} | ||
function msg { println "$*" >&2 ;} | ||
function println { printf '%s\n' "$(now) $*" ;} | ||
|
||
|
||
# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: | ||
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com | ||
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" | ||
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" | ||
mkdir -p ${SECRET_LOCATION} | ||
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") | ||
do | ||
msg "Retrieving secret ${key}" | ||
docker run --entrypoint=gcloud \ | ||
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ | ||
gcr.io/google.com/cloudsdktool/cloud-sdk \ | ||
secrets versions access latest \ | ||
--project cloud-devrel-kokoro-resources \ | ||
--secret ${key} > \ | ||
"${SECRET_LOCATION}/${key}" | ||
if [[ $? == 0 ]]; then | ||
msg "Secret written to ${SECRET_LOCATION}/${key}" | ||
else | ||
msg "Error retrieving secret ${key}" | ||
fi | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
# Format: //devtools/kokoro/config/proto/build.proto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
#!/bin/bash | ||
# Copyright 2020 Google LLC. | ||
# Copyright 2017 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. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file or at | ||
# https://developers.google.com/open-source/licenses/bsd | ||
|
||
set -eo pipefail | ||
|
||
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" || ret_code=$? | ||
|
||
chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh | ||
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh || true | ||
# 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 | ||
|
||
exit ${ret_code} | ||
$(dirname $0)/populate-secrets.sh # Secret Manager secrets. | ||
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file or at | ||
# https://developers.google.com/open-source/licenses/bsd | ||
|
||
"""This script is used to synthesize generated parts of this library.""" | ||
import re | ||
|
||
import synthtool as s | ||
import synthtool.gcp as gcp | ||
|
||
|
||
# Add templated files | ||
# ---------------------------------------------------------------------------- | ||
templated_files = gcp.CommonTemplates().py_library(microgenerator=True) | ||
|
||
# Just move templates for building docs and releases | ||
# Presubmit and continuous are configured differently | ||
s.move(templated_files / ".trampolinerc") | ||
s.move(templated_files / ".kokoro" / "docker") | ||
s.move(templated_files / ".kokoro" / "docs") | ||
s.move(templated_files / ".kokoro" / "release.sh") | ||
s.move(templated_files / ".kokoro" / "trampoline_v2.sh") | ||
s.move(templated_files / ".kokoro" / "trampoline.sh") | ||
s.move(templated_files / ".kokoro" / "populate-secrets.sh") | ||
s.move(templated_files / ".kokoro" / "release") | ||
|
||
# Replace the Apache Licenses in the `.kokoro` directory | ||
# with the BSD license expected in this repository | ||
s.replace( | ||
".kokoro/**/*", | ||
"# Copyright.*(\d{4}).*# limitations under the License\.", | ||
"""# Copyright \g<1> Google LLC | ||
# | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file or at | ||
# https://developers.google.com/open-source/licenses/bsd""", | ||
flags=re.DOTALL | ||
) | ||
|
||
s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.