gh-actions
This commit is contained in:
@ -15,8 +15,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
docs_path: "doc/build/html"
|
docs_path: "doc/build/html"
|
||||||
docs_service: {{ service_uri }}
|
docs_service: {{ service_uri }}
|
||||||
swift_container: "gitea_action_logs"
|
{%- if environment == 'internal' %}
|
||||||
{% raw -%}
|
{% raw -%}
|
||||||
|
swift_container: "gitea_action_logs"
|
||||||
otc_swift_username: ${{ secrets.OTC_SWIFT_USERNAME }}
|
otc_swift_username: ${{ secrets.OTC_SWIFT_USERNAME }}
|
||||||
otc_swift_password: ${{ secrets.OTC_SWIFT_PASSWORD }}
|
otc_swift_password: ${{ secrets.OTC_SWIFT_PASSWORD }}
|
||||||
otc_swift_project_name: ${{ secrets.OTC_SWIFT_PROJECT_NAME }}
|
otc_swift_project_name: ${{ secrets.OTC_SWIFT_PROJECT_NAME }}
|
||||||
@ -27,4 +28,19 @@ jobs:
|
|||||||
repo: ${{ gitea.repository }}
|
repo: ${{ gitea.repository }}
|
||||||
pr_number: ${{ gitea.event.pull_request.number }}
|
pr_number: ${{ gitea.event.pull_request.number }}
|
||||||
run_id: ${{ gitea.run_id }}
|
run_id: ${{ gitea.run_id }}
|
||||||
{%- endraw %}
|
{%- endraw %}
|
||||||
|
{%- elif environment == 'public' %}
|
||||||
|
{% raw -%}
|
||||||
|
swift_container: "github_action_logs"
|
||||||
|
otc_swift_username: ${{ secrets.OTC_SWIFT_USERNAME }}
|
||||||
|
otc_swift_password: ${{ secrets.OTC_SWIFT_PASSWORD }}
|
||||||
|
otc_swift_project_name: ${{ secrets.OTC_SWIFT_PROJECT_NAME }}
|
||||||
|
otc_swift_domain: ${{ secrets.OTC_SWIFT_DOMAIN }}
|
||||||
|
otc_swift_endpoint: ${{ secrets.OTC_SWIFT_ENDPOINT }}
|
||||||
|
gitea_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
gitea_server_url: ${{ github.server_url }}
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.pull_request.number }}
|
||||||
|
run_id: ${{ github.run_id }}
|
||||||
|
{%- endraw %}
|
||||||
|
{%- endif %}
|
@ -15,8 +15,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
docs_path: "doc/build/pdf"
|
docs_path: "doc/build/pdf"
|
||||||
docs_service: {{ service_uri }}
|
docs_service: {{ service_uri }}
|
||||||
swift_container: "gitea_action_logs"
|
{%- if environment == 'internal' %}
|
||||||
{% raw -%}
|
{% raw -%}
|
||||||
|
swift_container: "gitea_action_logs"
|
||||||
otc_swift_username: ${{ secrets.OTC_SWIFT_USERNAME }}
|
otc_swift_username: ${{ secrets.OTC_SWIFT_USERNAME }}
|
||||||
otc_swift_password: ${{ secrets.OTC_SWIFT_PASSWORD }}
|
otc_swift_password: ${{ secrets.OTC_SWIFT_PASSWORD }}
|
||||||
otc_swift_project_name: ${{ secrets.OTC_SWIFT_PROJECT_NAME }}
|
otc_swift_project_name: ${{ secrets.OTC_SWIFT_PROJECT_NAME }}
|
||||||
@ -27,4 +28,19 @@ jobs:
|
|||||||
repo: ${{ gitea.repository }}
|
repo: ${{ gitea.repository }}
|
||||||
pr_number: ${{ gitea.event.pull_request.number }}
|
pr_number: ${{ gitea.event.pull_request.number }}
|
||||||
run_id: ${{ gitea.run_id }}
|
run_id: ${{ gitea.run_id }}
|
||||||
{%- endraw %}
|
{%- endraw %}
|
||||||
|
{%- elif environment == 'public' %}
|
||||||
|
{% raw -%}
|
||||||
|
swift_container: "github_action_logs"
|
||||||
|
otc_swift_username: ${{ secrets.OTC_SWIFT_USERNAME }}
|
||||||
|
otc_swift_password: ${{ secrets.OTC_SWIFT_PASSWORD }}
|
||||||
|
otc_swift_project_name: ${{ secrets.OTC_SWIFT_PROJECT_NAME }}
|
||||||
|
otc_swift_domain: ${{ secrets.OTC_SWIFT_DOMAIN }}
|
||||||
|
otc_swift_endpoint: ${{ secrets.OTC_SWIFT_ENDPOINT }}
|
||||||
|
gitea_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
gitea_server_url: ${{ github.server_url }}
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
pr_number: ${{ github.event.pull_request.number }}
|
||||||
|
run_id: ${{ github.run_id }}
|
||||||
|
{%- endraw %}
|
||||||
|
{%- endif %}
|
@ -371,21 +371,33 @@ def process_repositories(args, service):
|
|||||||
"""Update actions"""
|
"""Update actions"""
|
||||||
context = dict(docs=[])
|
context = dict(docs=[])
|
||||||
context["service_uri"] = service['service_uri']
|
context["service_uri"] = service['service_uri']
|
||||||
|
context["environment"] = args.target_environment
|
||||||
|
|
||||||
actions_yaml_content_html = actions_yaml_template_html.render(**context)
|
actions_yaml_content_html = actions_yaml_template_html.render(**context)
|
||||||
actions_yaml_content_pdf = actions_yaml_template_pdf.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")
|
if args.target_environment == "internal":
|
||||||
actions_yaml_content_html_path.parent.mkdir(parents=True, exist_ok=True)
|
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")
|
actions_yaml_content_html_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
actions_yaml_content_pdf_path.parent.mkdir(parents=True, exist_ok=True)
|
actions_yaml_content_pdf_path = pathlib.Path(copy_to, ".gitea", "workflows", "build-pdf-docs.yaml")
|
||||||
|
actions_yaml_content_pdf_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
elif args.target_environment == "public":
|
||||||
|
actions_yaml_content_html_path = pathlib.Path(copy_to, ".github", "workflows", "build-html-docs.yaml")
|
||||||
|
actions_yaml_content_html_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
actions_yaml_content_pdf_path = pathlib.Path(copy_to, ".github", "workflows", "build-pdf-docs.yaml")
|
||||||
|
actions_yaml_content_pdf_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
with open(actions_yaml_content_html_path, "w", encoding="utf-8", newline="") as out:
|
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...")
|
logging.debug(f"Generating {actions_yaml_content_html_path} from template...")
|
||||||
out.write(actions_yaml_content_html)
|
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:
|
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...")
|
logging.debug(f"Generating {actions_yaml_content_pdf_path} from template...")
|
||||||
out.write(actions_yaml_content_pdf)
|
out.write(actions_yaml_content_pdf)
|
||||||
repo_to.index.add([".gitea/workflows/build-pdf-docs.yaml"])
|
if args.target_environment == "internal":
|
||||||
|
repo_to.index.add([".gitea/workflows/build-html-docs.yaml"])
|
||||||
|
repo_to.index.add([".gitea/workflows/build-pdf-docs.yaml"])
|
||||||
|
elif args.target_environment == "public":
|
||||||
|
repo_to.index.add([".github/workflows/build-html-docs.yaml"])
|
||||||
|
repo_to.index.add([".github/workflows/build-pdf-docs.yaml"])
|
||||||
|
|
||||||
if len(repo_to.index.diff("HEAD")) == 0:
|
if len(repo_to.index.diff("HEAD")) == 0:
|
||||||
# Nothing to commit
|
# Nothing to commit
|
||||||
|
Reference in New Issue
Block a user