Skip to content

Commit

Permalink
build: migrate release scripts (#1799) (#1347)
Browse files Browse the repository at this point in the history
* build: migrate release scripts (#1799)

Source-Link: googleapis/synthtool@1fd6dff
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:ad9cabee4c022f1aab04a71332369e0c23841062124818a4490f73337f790337

* build: only append common_env_vars if it doesn't exist

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <[email protected]>
  • Loading branch information
3 people authored May 20, 2023
1 parent b3b9d5f commit a3aa2ee
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
digest: sha256:8dd8395defb6a5069b0b10c435058bf13980606ba1967e2b3925ed50fc3cb22f
digest: sha256:ad9cabee4c022f1aab04a71332369e0c23841062124818a4490f73337f790337
1 change: 1 addition & 0 deletions .github/release-trigger.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
enabled: true
multiScmName: java-logging
20 changes: 20 additions & 0 deletions .kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,23 @@ env_vars: {

###################################################



#############################################
# this section merged from .kokoro/common_env_vars.cfg using owlbot.py

env_vars: {
key: "PRODUCT_AREA_LABEL"
value: "observability"
}
env_vars: {
key: "PRODUCT_LABEL"
value: "logging"
}
env_vars: {
key: "LANGUAGE_LABEL"
value: "java"
}

###################################################

25 changes: 15 additions & 10 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,25 @@
# Modify test configs
# --------------------------------------------------------------------------

# add shared environment variables to test configs
s.move(
".kokoro/common_env_vars.cfg",
".kokoro/common.cfg",
merge=lambda src, dst, _, : f"{dst}\n{src}",
def _append_if_not_contained(src: str, dest: str, file: str):
if src in dest:
return dest
return f"{dest}\n{src}"

def append_new_content(src: str, dest: str):
# add shared environment variables to test configs
s.move(
src,
dest,
merge=_append_if_not_contained,
)

append_new_content(".kokoro/common_env_vars.cfg", ".kokoro/common.cfg")

tracked_subdirs = ["continuous", "presubmit", "release", "nightly"]
for subdir in tracked_subdirs:
for path, subdirs, files in os.walk(f".kokoro/{subdir}"):
for name in files:
if name == "common.cfg":
file_path = os.path.join(path, name)
s.move(
".kokoro/common_env_vars.cfg",
file_path,
merge=lambda src, dst, _, : f"{dst}\n{src}",
)
append_new_content(".kokoro/common_env_vars.cfg", file_path)

0 comments on commit a3aa2ee

Please sign in to comment.