blob: fa03d69135a5159a555f64180d5af31481454b62 [file] [log] [blame]
Bu Sun Kim65e33c02019-10-25 10:45:00 -07001import synthtool as s
2from synthtool import gcp
3
4common = gcp.CommonTemplates()
5
6# ----------------------------------------------------------------------------
7# Add templated files
8# ----------------------------------------------------------------------------
9templated_files = common.py_library(unit_cov_level=100, cov_level=100)
Tres Seaverb76f1512021-08-13 18:37:08 -040010
11
Yoshi Automation Bot218a1592020-07-06 13:59:22 -070012s.move(
13 templated_files / ".kokoro",
14 excludes=[
Bu Sun Kim621f54b2021-01-22 13:43:41 -070015 "continuous/common.cfg",
Tres Seaverb76f1512021-08-13 18:37:08 -040016 "docs/common.cfg",
Bu Sun Kim621f54b2021-01-22 13:43:41 -070017 "presubmit/common.cfg",
18 "build.sh",
Yoshi Automation Bot218a1592020-07-06 13:59:22 -070019 ],
20) # just move kokoro configs
Tres Seaverb76f1512021-08-13 18:37:08 -040021
22
23assert 1 == s.replace(
24 ".kokoro/docs/docs-presubmit.cfg",
25 'value: "docs docfx"',
26 'value: "docs"',
27)
28
29assert 1 == s.replace(
30 ".kokoro/docker/docs/Dockerfile",
31 """\
32CMD \["python3\.8"\]""",
33 """\
34# Install gcloud SDK
35RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \\
36 tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \\
37 && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \\
38 apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \\
39 && apt-get update -y \\
40 && apt-get install python2 google-cloud-sdk -y
41
42CMD ["python3.8"]""",
43)
44
45s.shell.run(["nox", "-s", "blacken"], hide_output=False)