Skip to content

Commit c01ba45

Browse files
chore(java): use separate autosynth job for README (#223)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/52bbaa55-e421-4eef-8134-3f067b5c8364/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@e616863
1 parent 593fc66 commit c01ba45

File tree

4 files changed

+115
-3
lines changed

4 files changed

+115
-3
lines changed

.github/readme/synth.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""This script is used to synthesize generated the README for this library."""
16+
17+
from synthtool.languages import java
18+
19+
java.custom_templates(["java_library/README.md"])

.kokoro/continuous/readme.cfg

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
env_vars: {
18+
key: "TRAMPOLINE_IMAGE"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
20+
}
21+
22+
env_vars: {
23+
key: "TRAMPOLINE_BUILD_FILE"
24+
value: "github/java-datastore/.kokoro/readme.sh"
25+
}
26+
27+
# Build logs will be here
28+
action {
29+
define_artifacts {
30+
regex: "**/*sponge_log.xml"
31+
regex: "**/*sponge_log.log"
32+
}
33+
}
34+
35+
# The github token is stored here.
36+
before_action {
37+
fetch_keystore {
38+
keystore_resource {
39+
keystore_config_id: 73713
40+
keyname: "yoshi-automation-github-key"
41+
# TODO(theacodes): remove this after secrets have globally propagated
42+
backend_type: FASTCONFIGPUSH
43+
}
44+
}
45+
}
46+
47+
# Common env vars for all repositories and builds.
48+
env_vars: {
49+
key: "GITHUB_USER"
50+
value: "yoshi-automation"
51+
}
52+
env_vars: {
53+
key: "GITHUB_EMAIL"
54+
value: "yoshi-automation@google.com"
55+
}

.kokoro/readme.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
cd ${KOKORO_ARTIFACTS_DIR}/github/java-datastore
19+
20+
# Disable buffering, so that the logs stream through.
21+
export PYTHONUNBUFFERED=1
22+
23+
# Kokoro exposes this as a file, but the scripts expect just a plain variable.
24+
export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key)
25+
26+
# Setup git credentials
27+
echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials
28+
git config --global credential.helper 'store --file ~/.git-credentials'
29+
30+
python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool
31+
python3.6 -m autosynth.synth \
32+
--repository=googleapis/java-datastore \
33+
--synth-file-name=.github/readme/synth.py \
34+
--metadata-path=.github/readme/synth.metadata \
35+
--pr-title="chore: regenerate README" \
36+
--branch-suffix="readme"

synth.metadata

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-datastore.git",
7-
"sha": "1f028b47f36430b00ae17cbb80eee324b875e237"
7+
"sha": "593fc662e11ea446cd3fc7864cfa9a1b75480fba"
88
}
99
},
1010
{
@@ -19,7 +19,7 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
22+
"sha": "e6168630be3e31eede633ba2c6f1cd64248dec1c"
2323
}
2424
}
2525
],
@@ -40,6 +40,7 @@
4040
".github/ISSUE_TEMPLATE/feature_request.md",
4141
".github/ISSUE_TEMPLATE/support_request.md",
4242
".github/PULL_REQUEST_TEMPLATE.md",
43+
".github/readme/synth.py",
4344
".github/release-please.yml",
4445
".github/trusted-contribution.yml",
4546
".github/workflows/auto-release.yaml",
@@ -52,6 +53,7 @@
5253
".kokoro/common.sh",
5354
".kokoro/continuous/common.cfg",
5455
".kokoro/continuous/java8.cfg",
56+
".kokoro/continuous/readme.cfg",
5557
".kokoro/dependencies.sh",
5658
".kokoro/linkage-monitor.sh",
5759
".kokoro/nightly/common.cfg",
@@ -75,6 +77,7 @@
7577
".kokoro/presubmit/linkage-monitor.cfg",
7678
".kokoro/presubmit/lint.cfg",
7779
".kokoro/presubmit/samples.cfg",
80+
".kokoro/readme.sh",
7881
".kokoro/release/bump_snapshot.cfg",
7982
".kokoro/release/common.cfg",
8083
".kokoro/release/common.sh",
@@ -92,7 +95,6 @@
9295
"CODE_OF_CONDUCT.md",
9396
"CONTRIBUTING.md",
9497
"LICENSE",
95-
"README.md",
9698
"codecov.yaml",
9799
"java.header",
98100
"license-checks.xml",

0 commit comments

Comments
 (0)