Compare commits

..

1 Commits

Author SHA1 Message Date
f4506b2141 adding constraints reference
All checks were successful
gl/check check status: success (f4506b2141ff8f2def622023d54b4111ef9d91d5)
gl/gate gate status: success (f4506b2141ff8f2def622023d54b4111ef9d91d5)
2023-08-09 11:33:40 +00:00
14 changed files with 26 additions and 249 deletions

3
.gitignore vendored
View File

@ -59,6 +59,3 @@ ChangeLog
# Files created by releasenotes build
releasenotes/build
bindep.txt
packages.txt

View File

@ -1,10 +0,0 @@
---
environment: internal
hc_location: api/lts
html_location: docs/lts/api-ref
link: /log-tank-service/api-ref/
pdf_name: lts-api-ref
rst_location: api-ref/source
service_type: lts
title: API Reference
type: api-ref

View File

@ -1,10 +0,0 @@
---
environment: internal
hc_location: usermanual/lts
html_location: docs/lts/umn
link: /log-tank-service/umn/
pdf_name: lts-umn
rst_location: umn/source
service_type: lts
title: User Guide
type: umn

View File

@ -1,4 +1,5 @@
---
environment: internal
hc_location: api/dwaf
html_location: docs/wafd/api-ref
link: /web-application-firewall-dedicated/api-ref/

View File

@ -1,4 +1,5 @@
---
environment: internal
hc_location: usermanual/dwaf
html_location: docs/wafd/umn
link: /web-application-firewall-dedicated/umn/

View File

@ -1,3 +1,3 @@
---
name: database
title: Databases
title: Database

View File

@ -1,16 +0,0 @@
---
environment: internal
repositories:
- environment: internal
repo: docs-swiss/log-tank-service
type: gitea
- environment: public
repo: opentelekomcloud-docs-swiss/log-tank-service
type: github
service_category: md
service_title: Log Tank Service
service_type: lts
service_uri: log-tank-service
teams:
- name: docs-orchestration-rw
permission: write

View File

@ -87,13 +87,10 @@ class Services(object):
res.append(copy.deepcopy(cat))
return res
def services_by_category(self, category, environment=None):
def services_by_category(self, category):
"""List services matching category"""
res = []
for srv in self.all_services:
if environment:
if "environment" in srv and srv["environment"] != environment:
continue
if srv["service_category"] == category:
res.append(copy.deepcopy(srv))
return res
@ -125,58 +122,6 @@ class Services(object):
res[cat]["docs"].append(res_doc)
return res
def service_types_with_doc_types(self, environment=None):
"""Retrieve type and title from services and corresponding docs.
As well as a list of all available doc types with title.
:param str environment: Optional service environment.
"""
service_list = []
docs = []
for service in self.all_services:
if "environment" in service:
if service["environment"] != environment:
continue
if not service["service_title"]:
continue
if not service["service_type"]:
continue
doc_list = []
for doc in self.all_docs:
if "environment" in doc:
if doc["environment"] != environment:
continue
if doc["service_type"] == service["service_type"]:
doc_list.append({
"title": doc["title"],
"type": doc["type"]
})
new_doc = {
"type": doc["type"],
"title": doc["title"]
}
type_exists = any(
doc_dict["type"] == new_doc["type"] for doc_dict in docs
)
if not type_exists:
docs.append(new_doc)
service_list.append({
"service_title": service["service_title"],
"service_type": service["service_type"],
"docs": doc_list
})
res = {
"services": service_list,
"docs": docs
}
return res
def docs_by_service_category(self, category, environment=None):
"""List services matching category
@ -240,8 +185,6 @@ class Services(object):
srv_res = dict(
service_title=srv["service_title"],
service_type=srv["service_type"],
service_category=srv["service_category"],
service_environment=environment,
docs=[],
)
if "teams" in srv:
@ -265,7 +208,6 @@ class Services(object):
rst_location=doc["rst_location"],
title=doc["title"],
type=doc.get("type", "dummy"),
link=doc["link"],
)
if "pdf_name" in doc:
doc_res["pdf_name"] = doc["pdf_name"]

View File

@ -16,8 +16,6 @@
import os
import sys
from git import Repo
from datetime import datetime
extensions = [
'otcdocstheme',
@ -28,6 +26,7 @@ extensions = [
otcdocs_auto_name = False
otcdocs_auto_version = False
otcdocs_search_environment = 'hc_swiss'
project = '{{ project }}'
otcdocs_repo_name = '{{ repo_name }}'
@ -39,18 +38,6 @@ otcdocs_git_fqdn = '{{ git_fqdn }}'
otcdocs_git_type = '{{ git_type }}'
{%- endif %}
# Those variables are needed for indexing into OpenSearch
otcdocs_doc_environment = '{{ doc_environment }}'
otcdocs_doc_link = '{{ doc_link }}'
otcdocs_doc_title = '{{ doc_title }}'
otcdocs_doc_type = '{{ doc_type }}'
otcdocs_service_category = '{{ service_category }}'
otcdocs_service_title = '{{ service_title }}'
otcdocs_service_type = '{{ service_type }}'
otcdocs_search_environment = 'hc_swiss'
otcdocs_search_index = 'search_index_swiss'
otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/"
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@ -120,7 +107,6 @@ html_title = "{{ title }}"
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
templates_path = ['_templates']
# Do not include sources into the rendered results
html_copy_source = False
@ -135,21 +121,3 @@ latex_documents = [
{% endif -%}
]
# Get the Git commit values for last updated timestamp on each page
repo = Repo(search_parent_directories=True)
commit = repo.head.commit
current_commit_hash = commit.hexsha
current_commit_time = commit.committed_datetime.strftime('%Y-%m-%d %H:%M')
latex_elements = {
'papersize': 'a4paper',
'pointsize': '12pt',
'figure_align': 'H',
'preamble': rf'''{% raw %}
\newcommand{{\githash}}{{{current_commit_hash}}}
\newcommand{{\gitcommittime}}{{{current_commit_time}}}
\newcommand{{\doctitle}}{{{otcdocs_doc_title}}}
\newcommand{{\servicetitle}}{{{otcdocs_service_title}}}{% endraw %}
''',
'sphinxsetup': 'hmargin={15mm,15mm}, vmargin={20mm,30mm}, marginpar=10mm'
}

View File

@ -1,16 +1,7 @@
sphinx>=2.0.0,!=2.1.0 # BSD
{% if target_environment == 'public' %}
otcdocstheme<2.0.0 # Apache-2.0
{% elif target_environment == 'internal' %}
otcdocstheme # Apache-2.0
{% else %}
otcdocstheme # Apache-2.0
{% endif %}
# releasenotes
reno>=3.1.0 # Apache-2.0
otc-sphinx-directives>=0.1.0
sphinx-minify>=0.0.1 # Apache-2.0
git+https://gitea.eco.tsi-dev.otc-service.com/infra/otc-metadata-swiss.git#egg=otc_metadata
setuptools
gitpython

View File

@ -5,4 +5,3 @@
.. service_card::
:service_type: {{ service_type }}
:environment: {{ environment }}

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +0,0 @@
---
- project:
merge-mode: squash-merge
default-branch: main
templates:
- helpcenter-swiss-base-jobs
check:
jobs:
- noop
gate:
jobs:
- noop

File diff suppressed because it is too large Load Diff