added template for gitea actions
This commit is contained in:
@ -54,6 +54,8 @@ def process_repositories(args, service):
|
||||
zuul_yaml_template = env.get_template("zuul.yaml.j2")
|
||||
index_sbv_template = env.get_template("index_sbv.rst.j2")
|
||||
doc_requirements_template = env.get_template("doc_requirements.txt.j2")
|
||||
actions_yaml_template_html = env.get_template("build-html-docs.yaml.j2")
|
||||
actions_yaml_template_pdf = env.get_template("build-pdf-docs.yaml.j2")
|
||||
|
||||
for repo in service["repositories"]:
|
||||
if repo["cloud_environments"][0] == args.cloud_environment:
|
||||
@ -365,6 +367,24 @@ def process_repositories(args, service):
|
||||
out.write(zuul_yaml_content)
|
||||
repo_to.index.add(["zuul.yaml"])
|
||||
|
||||
if args.update_actions:
|
||||
"""Update actions"""
|
||||
context = dict(docs=[])
|
||||
context["service_uri"] = service['service_uri']
|
||||
|
||||
actions_yaml_content_html = actions_yaml_template_html.render(**context)
|
||||
actions_yaml_content_pdf = actions_yaml_template_pdf.render(**context)
|
||||
actions_yaml_content_html_path = pathlib.Path(copy_to, ".gitea", "workflows", "build-html-docs.yaml")
|
||||
actions_yaml_content_pdf_path = pathlib.Path(copy_to, ".gitea", "workflows", "build-pdf-docs.yaml")
|
||||
with open(actions_yaml_content_html_path, "w", encoding="utf-8", newline="") as out:
|
||||
logging.debug(f"Generating {actions_yaml_content_html_path} from template...")
|
||||
out.write(actions_yaml_content_html)
|
||||
repo_to.index.add([".gitea/workflows/build-html-docs.yaml"])
|
||||
with open(actions_yaml_content_pdf_path, "w", encoding="utf-8", newline="") as out:
|
||||
logging.debug(f"Generating {actions_yaml_content_pdf_path} from template...")
|
||||
out.write(actions_yaml_content_pdf)
|
||||
repo_to.index.add([".gitea/workflows/build-pdf-docs.yaml"])
|
||||
|
||||
if len(repo_to.index.diff("HEAD")) == 0:
|
||||
# Nothing to commit
|
||||
logging.debug(
|
||||
@ -464,6 +484,11 @@ def main():
|
||||
action="store_true",
|
||||
help="Whether to update zuul.yaml"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--update-actions",
|
||||
action="store_true",
|
||||
help="Whether to update the action yaml files for rendering docs."
|
||||
)
|
||||
parser.add_argument(
|
||||
"--overwrite-index-sbv",
|
||||
action="store_true",
|
||||
|
Reference in New Issue
Block a user