This repository was archived by the owner on Mar 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathowlbot.py
More file actions
44 lines (35 loc) · 1.53 KB
/
owlbot.py
File metadata and controls
44 lines (35 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import synthtool as s
from synthtool import gcp
from synthtool.languages import python
AUTOSYNTH_MULTIPLE_PRS = True
common = gcp.CommonTemplates()
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=100, cov_level=100)
python.py_samples(skip_readmes=True)
s.move(templated_files / '.kokoro')
s.move(templated_files / '.trampolinerc')
s.move(templated_files / "renovate.json")
s.replace(".kokoro/build.sh", """(export PROJECT_ID=.*)""", """\g<1>
if [[ -f "${KOKORO_GFILE_DIR}/service-account.json" ]]; then
# Configure local Redis to be used
export REDIS_CACHE_URL=redis://localhost
redis-server &
# Configure local memcached to be used
export MEMCACHED_HOSTS=127.0.0.1
service memcached start
# Some system tests require indexes. Use gcloud to create them.
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS --project=$PROJECT_ID
gcloud --quiet --verbosity=debug datastore indexes create tests/system/index.yaml
fi
""")
s.replace(".kokoro/build.sh",
"""# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=\$\{KOKORO_GFILE_DIR\}/service-account.json""",
"""if [[ -f "${KOKORO_GFILE_DIR}/service-account.json" ]]; then
# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
fi"""
)
s.shell.run(["nox", "-s", "blacken"], hide_output=False)