Skip to content

Commit c54aa89

Browse files
committed
chore: add separate README synth
1 parent 1a295b8 commit c54aa89

File tree

4 files changed

+118
-1
lines changed

4 files changed

+118
-1
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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
# Configure the docker image for kokoro-trampoline.
18+
env_vars: {
19+
key: "TRAMPOLINE_IMAGE"
20+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
21+
}
22+
23+
env_vars: {
24+
key: "TRAMPOLINE_BUILD_FILE"
25+
value: "github/java-security-private-ca/.kokoro/readme.sh"
26+
}
27+
28+
# Build logs will be here
29+
action {
30+
define_artifacts {
31+
regex: "**/*sponge_log.xml"
32+
regex: "**/*sponge_log.log"
33+
}
34+
}
35+
36+
# The github token is stored here.
37+
before_action {
38+
fetch_keystore {
39+
keystore_resource {
40+
keystore_config_id: 73713
41+
keyname: "yoshi-automation-github-key"
42+
# TODO(theacodes): remove this after secrets have globally propagated
43+
backend_type: FASTCONFIGPUSH
44+
}
45+
}
46+
}
47+
48+
# Common env vars for all repositories and builds.
49+
env_vars: {
50+
key: "GITHUB_USER"
51+
value: "yoshi-automation"
52+
}
53+
env_vars: {
54+
key: "GITHUB_EMAIL"
55+
56+
}

.kokoro/readme.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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-security-private-ca
19+
20+
# Disable buffering, so that the logs stream through.
21+
export PYTHONUNBUFFERED=1
22+
23+
# Add github to known hosts.
24+
#ssh-keyscan github.com >> ~/.ssh/known_hosts
25+
26+
# Kokoro exposes this as a file, but the scripts expect just a plain variable.
27+
export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key)
28+
29+
# Setup git credentials
30+
echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials
31+
git config --global credential.helper 'store --file ~/.git-credentials'
32+
33+
python3.6 -m pip install git+https://github.com/chingor13/synthtool.git@java-readme#egg=gcp-synthtool
34+
python3.6 -m autosynth.synth \
35+
--repository=chingor13/java-security-private-ca \
36+
--synth-file-name=.github/readme/synth.py \
37+
--metadata-path=.github/readme/synth.metadata \
38+
--pr-title="chore: regenerate README" \
39+
--branch-suffix="readme"

synth.metadata

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@
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",
46+
".github/workflows/auto-release.yaml",
4547
".github/workflows/ci.yaml",
4648
".github/workflows/samples.yaml",
4749
".kokoro/build.bat",
@@ -51,6 +53,7 @@
5153
".kokoro/common.sh",
5254
".kokoro/continuous/common.cfg",
5355
".kokoro/continuous/java8.cfg",
56+
".kokoro/continuous/readme.cfg",
5457
".kokoro/dependencies.sh",
5558
".kokoro/linkage-monitor.sh",
5659
".kokoro/nightly/common.cfg",
@@ -74,6 +77,7 @@
7477
".kokoro/presubmit/linkage-monitor.cfg",
7578
".kokoro/presubmit/lint.cfg",
7679
".kokoro/presubmit/samples.cfg",
80+
".kokoro/readme.sh",
7781
".kokoro/release/bump_snapshot.cfg",
7882
".kokoro/release/common.cfg",
7983
".kokoro/release/common.sh",
@@ -91,7 +95,6 @@
9195
"CODE_OF_CONDUCT.md",
9296
"CONTRIBUTING.md",
9397
"LICENSE",
94-
"README.md",
9598
"codecov.yaml",
9699
"google-cloud-security-private-ca/src/main/java/com/google/cloud/security/privateca/v1beta1/CertificateAuthorityServiceClient.java",
97100
"google-cloud-security-private-ca/src/main/java/com/google/cloud/security/privateca/v1beta1/CertificateAuthorityServiceSettings.java",

0 commit comments

Comments
 (0)