Bu Sun Kim | f706cfd | 2020-04-20 14:05:05 -0700 | [diff] [blame] | 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 | import synthtool as s |
| 16 | from synthtool import gcp |
Anthonios Partheniou | af918e8 | 2020-11-25 19:58:04 -0500 | [diff] [blame] | 17 | |
release-please[bot] | fd2965c | 2021-08-11 17:00:21 +0000 | [diff] [blame] | 18 | from synthtool.languages import python |
Bu Sun Kim | f706cfd | 2020-04-20 14:05:05 -0700 | [diff] [blame] | 19 | |
| 20 | common = gcp.CommonTemplates() |
| 21 | |
| 22 | # ---------------------------------------------------------------------------- |
| 23 | # Add templated files |
| 24 | # ---------------------------------------------------------------------------- |
| 25 | templated_files = common.py_library() |
| 26 | |
| 27 | # Copy kokoro configs. |
| 28 | # Docs are excluded as repo docs cannot currently be generated using sphinx. |
| 29 | s.move(templated_files / '.kokoro', excludes=['**/docs/*', 'publish-docs.sh']) |
| 30 | |
| 31 | # Also move issue templates |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 32 | s.move(templated_files / '.github') |
release-please[bot] | fd2965c | 2021-08-11 17:00:21 +0000 | [diff] [blame] | 33 | |
| 34 | # Move scripts folder needed for samples CI |
| 35 | s.move(templated_files / 'scripts') |
| 36 | |
| 37 | # ---------------------------------------------------------------------------- |
| 38 | # Samples templates |
| 39 | # ---------------------------------------------------------------------------- |
| 40 | |
| 41 | python.py_samples(skip_readmes=True) |
Anthonios Partheniou | e9a5d08 | 2021-08-25 12:30:26 -0400 | [diff] [blame^] | 42 | |
| 43 | # Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged |
| 44 | |
| 45 | # Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files |
| 46 | s.replace(".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main") |