diff --git a/.github/workflows/sphinx.yaml b/.github/workflows/sphinx.yaml new file mode 100644 index 0000000000000000000000000000000000000000..60011acbdcc931518cf6422f003f3ac562540ef3 --- /dev/null +++ b/.github/workflows/sphinx.yaml @@ -0,0 +1,30 @@ +name: "Sphinx: render docs" + +on: + push: + branches: + - develop + +jobs: + docs: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python environment + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install requirements + run: | + python3 -m pip install -r requirements.txt + python3 -m pip install -e . + - name: Build documentation + run: TZ=UTC sphinx-build -b html docs/source docs/build + - uses: peaceiris/actions-gh-pages@v3 + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/ + enable_jekyll: false diff --git a/.gitignore b/.gitignore index dfdc67da9e07f8516efdc4e2f5c130db382efcff..bce88d2bb8297e6a2fa4584b416e671fd5b91c8e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ coverage.xml docs/build docs/source/_static/openapi.json docs/vale/styles/* -!docs/vale/styles/Vocab/ +!docs/vale/styles/config/ venv/ .venv/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 323c1f19acd847dffd33494f6466300e576f2558..3bd2f9ead7bf919f2cd59793306dea1301130a18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - tox - documentation + - sonarqube - trigger_jenkins_build include: @@ -42,6 +43,14 @@ run-tox-pipeline: - htmlcov - docs/source/_static/openapi.json +sonarqube: + stage: sonarqube + image: sonarsource/sonar-scanner-cli + script: + - sonar-scanner -Dsonar.login=$SONAR_TOKEN -Dproject.settings=./sonar.properties + tags: + - docker-executor + trigger_jenkins_build: stage: trigger_jenkins_build image: alpine:latest diff --git a/Changelog.md b/Changelog.md index 9953fb48a40444784b14a88356bf75ac6756d575..6e87917c56c453e97b5924e3a1f48a938438a422 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,8 @@ # Changelog All notable changes to this project will be documented in this file. - +## [1.1] - 2024-02-09 +GEANT GAP Ansible collection is with version in galaxy requirements. ## [1.0] - 2024-01-03 The very first major release of LSO is here! :tada: A transparent API for running Ansible playbooks on a remote machine. diff --git a/LICENSE.txt b/LICENSE.txt index 8dd3635453d3056a61cdd56ca0b1f058d8ef8d76..434f38751e206a7200a234cc5f4849db0ebf4df5 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 GÉANT Vereniging +Copyright (c) 2023-2024 GÉANT Vereniging Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 357f8ec0fb0368beb5d185b9065089067e192959..b88ade7215d276084e191c8cc3169638c720c2dd 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ LSO: an API that allows for remotely executing Ansible playbooks -## Running locally -### Standalone deployment +## General documentation -Build documentation using `build-docs.sh`, and check out the quickstart page. +General documentation is available at <https://docs.gap.geant.org/> -### Docker deployment -Run the following from the root, then refer to the above documentation for usage. +## Code documentation + +Code documentation can be found at <https://workfloworchestrator.org/lso> \ No newline at end of file diff --git a/ansible-galaxy-requirements.yaml b/ansible-galaxy-requirements.yaml index 87bfd16f04531bccdd0e0a8fa0f7aede50f35a7f..3e784307c1a966995e486fcb2f5c739f4cb06ad1 100644 --- a/ansible-galaxy-requirements.yaml +++ b/ansible-galaxy-requirements.yaml @@ -1,8 +1,8 @@ collections: -- community.general -- juniper.device -- junipernetworks.junos -- geant.gap_ansible + - community.general + - juniper.device + - junipernetworks.junos + - name: geant.gap_ansible + version: 1.0.46 roles: -- Juniper.junos - + - Juniper.junos diff --git a/build-docs.sh b/build-docs.sh index 1e935bedadb15cea9616cee9e1b5feaf13aa3416..9ac7997e286c2dbd0073f597c323c80de11eb992 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -5,12 +5,8 @@ set -o nounset pip install -r requirements.txt pip install -e . -export SETTINGS_FILENAME=./config.json.example -python docs/dump-openapi-spec.py - rm -r ./docs/build/* vale --config=docs/vale/.vale.ini sync vale --config=docs/vale/.vale.ini docs/source/*.rst lso/*.py -sphinx-build -b html docs/source docs/build -unset SETTINGS_FILENAME +sphinx-build -b html docs/source docs/build diff --git a/docs/.gitlab-ci.yml b/docs/.gitlab-ci.yml index 8df93e5d182093000c643012a07ba817c3b5afd2..17e02529afc03a7e08b86014b109fb0ce761b372 100644 --- a/docs/.gitlab-ci.yml +++ b/docs/.gitlab-ci.yml @@ -12,7 +12,8 @@ lint-documentation: - job: run-tox-pipeline # Only run when tox has finished before_script: - - vale --config=docs/vale/.vale.ini sync + - cd $CI_PROJECT_DIR/docs/vale + - vale sync script: - - vale --config=docs/vale/.vale.ini docs/source/*.rst lso/*.py + - vale $CI_PROJECT_DIR/docs/source/*.rst $CI_PROJECT_DIR/lso/*.py diff --git a/docs/dump-openapi-spec.py b/docs/dump-openapi-spec.py deleted file mode 100644 index 964489e83af35cf1cd2df09aef3b869417d2f2ec..0000000000000000000000000000000000000000 --- a/docs/dump-openapi-spec.py +++ /dev/null @@ -1,20 +0,0 @@ -import json -import os - -from fastapi.testclient import TestClient -import lso - -config_filename = os.path.join(os.path.dirname(__file__), "..", "config.json.example") - -output_filename = os.path.join(os.path.dirname(__file__), "source", "_static", "openapi.json") - -os.environ["SETTINGS_FILENAME"] = config_filename -app = lso.create_app() -client = TestClient(app) -rsp = client.get("/openapi.json") -openapi_doc = json.dumps(rsp.json(), indent=2) - -with open(output_filename, "w") as f: - f.write(openapi_doc) - -print(f"wrote {output_filename}") diff --git a/docs/source/_static/openapi.html b/docs/source/_static/openapi.html deleted file mode 100644 index 8f99a538954cd6364240e9e6c5a60a212ddd44ed..0000000000000000000000000000000000000000 --- a/docs/source/_static/openapi.html +++ /dev/null @@ -1,25 +0,0 @@ -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta - name="description" - content="SwaggerUI" - /> - <title>SwaggerUI</title> - <link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui.css" /> -</head> -<body> -<div id="swagger-ui"></div> -<script src="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui-bundle.js" crossorigin></script> -<script> - window.onload = () => { - window.ui = SwaggerUIBundle({ - url: 'openapi.json', - dom_id: '#swagger-ui', - }); - }; -</script> -</body> -</html> - diff --git a/docs/source/index.rst b/docs/source/index.rst index 3732b95b005e234b97ace16d5222488bbf7b78a1..9e5c505600059c4517dcb99793126e1558fbac2f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,6 +9,3 @@ Documentation for LSO (Lightweight Service Orchestrator). quickstart modules - - -`Swagger API Docs <_static/openapi.html>`_ diff --git a/docs/vale/styles/Vocab/Sphinx/accept.txt b/docs/vale/styles/config/vocabularies/Sphinx/accept.txt similarity index 100% rename from docs/vale/styles/Vocab/Sphinx/accept.txt rename to docs/vale/styles/config/vocabularies/Sphinx/accept.txt diff --git a/docs/vale/styles/Vocab/geant-jargon/accept.txt b/docs/vale/styles/config/vocabularies/geant-jargon/accept.txt similarity index 100% rename from docs/vale/styles/Vocab/geant-jargon/accept.txt rename to docs/vale/styles/config/vocabularies/geant-jargon/accept.txt diff --git a/setup.py b/setup.py index 4ad8e3cc1846f931c49307a4595dc959e10de7a9..54c33252b69511b940154102a72d8add4f71cd5f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup setup( name="goat-lso", - version="1.0", + version="1.1", author="GÉANT Orchestration & Automation Team", author_email="goat@geant.org", description="Lightweight Service Orchestrator", diff --git a/sonar.properties b/sonar.properties new file mode 100644 index 0000000000000000000000000000000000000000..340ffdfee3dbc790e2f29449ac2744aba19e1f9f --- /dev/null +++ b/sonar.properties @@ -0,0 +1,6 @@ +sonar.projectKey=lso +sonar.projectName='Lightweight Service Orchestrator' +sonar.projectVersion=1.0 +sonar.sources=lso +sonar.python.coverage.reportPaths=coverage.xml +sonar.host.url=https://sonarqube.software.geant.org/