-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'BABEL_4_X_DEV__PG_16_X' into BABEL-2170-v2-pg16_1
- Loading branch information
Showing
624 changed files
with
145,696 additions
and
78,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
"""Additional CI configuration, using the starlark language. See | ||
https://cirrus-ci.org/guide/programming-tasks/#introduction-into-starlark | ||
See also the starlark specification at | ||
https://github.com/bazelbuild/starlark/blob/master/spec.md | ||
See also .cirrus.yml and src/tools/ci/README | ||
""" | ||
|
||
load("cirrus", "env", "fs") | ||
|
||
|
||
def main(): | ||
"""The main function is executed by cirrus-ci after loading .cirrus.yml and can | ||
extend the CI definition further. | ||
As documented in .cirrus.yml, the final CI configuration is composed of | ||
1) the contents of .cirrus.yml | ||
2) if defined, the contents of the file referenced by the, repository | ||
level, REPO_CI_CONFIG_GIT_URL variable (see | ||
https://cirrus-ci.org/guide/programming-tasks/#fs for the accepted | ||
format) | ||
3) .cirrus.tasks.yml | ||
""" | ||
|
||
output = "" | ||
|
||
# 1) is evaluated implicitly | ||
|
||
# Add 2) | ||
repo_config_url = env.get("REPO_CI_CONFIG_GIT_URL") | ||
if repo_config_url != None: | ||
print("loading additional configuration from \"{}\"".format(repo_config_url)) | ||
output += config_from(repo_config_url) | ||
else: | ||
output += "\n# REPO_CI_CONFIG_URL was not set\n" | ||
|
||
# Add 3) | ||
output += config_from(".cirrus.tasks.yml") | ||
|
||
return output | ||
|
||
|
||
def config_from(config_src): | ||
"""return contents of config file `config_src`, surrounded by markers | ||
indicating start / end of the the included file | ||
""" | ||
|
||
config_contents = fs.read(config_src) | ||
config_fmt = """ | ||
### | ||
# contents of config file `{0}` start here | ||
### | ||
{1} | ||
### | ||
# contents of config file `{0}` end here | ||
### | ||
""" | ||
return config_fmt.format(config_src, config_contents) |
Oops, something went wrong.