Update 'zuul.yaml'
Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com> Co-authored-by: gtema <artem.goncharov@gmail.com> Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
parent
e0dc83ddc4
commit
ba65aca9eb
@ -1,3 +1,3 @@
|
||||
[DEFAULT]
|
||||
test_path=./otc-metadata/tests
|
||||
test_path=./otc_metadata/tests/
|
||||
top_dir=./
|
||||
|
@ -28,6 +28,7 @@ def read_data(filename):
|
||||
with open(filepath, 'r') as fd:
|
||||
return yaml.safe_load(fd)
|
||||
|
||||
|
||||
def rewrite_data(filename, data):
|
||||
"""Rewrites data formatting it
|
||||
|
||||
|
@ -15,7 +15,7 @@ import copy
|
||||
|
||||
import otc_metadata.data
|
||||
|
||||
__all__ = ['Docs']
|
||||
__all__ = ['Service']
|
||||
|
||||
BUILTIN_DATA = otc_metadata.data.read_data('docs.yaml')
|
||||
|
||||
|
@ -40,7 +40,8 @@ class Services(object):
|
||||
|
||||
# sort docs list by <service_type>_<title>
|
||||
self._service_data["documents"] = sorted(
|
||||
sorted_docs, key=lambda x: f"{x.get('service_type')}{x.get('title')}"
|
||||
sorted_docs,
|
||||
key=lambda x: f"{x.get('service_type')}{x.get('title')}"
|
||||
)
|
||||
# sort services by <service_type>_<service_title>
|
||||
self._service_data["services"] = sorted(
|
||||
@ -183,7 +184,10 @@ class Services(object):
|
||||
]
|
||||
if "repositories" in srv and environment:
|
||||
for repo in srv["repositories"]:
|
||||
if "environment" in repo and repo["environment"] == environment:
|
||||
if (
|
||||
"environment" in repo
|
||||
and repo["environment"] == environment
|
||||
):
|
||||
srv_res["repository"] = repo["repo"]
|
||||
for doc in self.all_docs:
|
||||
if (
|
||||
|
@ -1,23 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2010-2011 OpenStack Foundation
|
||||
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
class TestCase(TestCase):
|
||||
|
||||
"""Test case base class for all unit tests."""
|
@ -19,10 +19,10 @@ test_otc-metadata
|
||||
Tests for `otc-metadata` module.
|
||||
"""
|
||||
|
||||
from otc-metadata.tests import base
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
class TestOtc-metadata(base.TestCase):
|
||||
class TestOtcMetadata(TestCase):
|
||||
|
||||
def test_something(self):
|
||||
pass
|
@ -1,11 +1,11 @@
|
||||
[metadata]
|
||||
name = otc-metadata
|
||||
summary = Metadata about OTC for Ecosystem
|
||||
description-file =
|
||||
description_file =
|
||||
README.rst
|
||||
author = Open Telekom Cloud
|
||||
home-page = https://open.telekom.cloud/
|
||||
python-requires = >=3.6
|
||||
home_page = https://open.telekom.cloud/
|
||||
python_requires = >=3.6
|
||||
classifier =
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
|
1
setup.py
1
setup.py
@ -11,7 +11,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
|
@ -2,9 +2,6 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
hacking>=3.0,<3.1 # Apache-2.0
|
||||
|
||||
coverage>=4.0,!=4.4 # Apache-2.0
|
||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||
stestr>=1.0.0 # Apache-2.0
|
||||
testtools>=1.4.0 # MIT
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
testtools>=2.2.0 # MIT
|
||||
flake8
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
import copy
|
||||
import re
|
||||
|
||||
import otc_metadata.services
|
||||
@ -7,21 +6,17 @@ from ruamel.yaml import YAML
|
||||
data = otc_metadata.services.Services()
|
||||
new_data = data._service_data
|
||||
|
||||
#services = data.service_dict
|
||||
# services = data.service_dict
|
||||
|
||||
for doc in new_data["documents"]:
|
||||
hc_location = None
|
||||
link = doc.get("link")
|
||||
if link:
|
||||
print(f"Parsing {link}")
|
||||
#(p1, p2) = link.split("/")
|
||||
doc["link"] = re.sub(
|
||||
r"/(.*)/(.*)/",
|
||||
r"/\2/\1/",
|
||||
link
|
||||
)
|
||||
# (p1, p2) = link.split("/")
|
||||
doc["link"] = re.sub(r"/(.*)/(.*)/", r"/\2/\1/", link)
|
||||
|
||||
_yaml = YAML()
|
||||
_yaml.indent(mapping=2, sequence=4, offset=2)
|
||||
with open('new.yaml', 'w') as fd:
|
||||
with open("new.yaml", "w") as fd:
|
||||
_yaml.dump(new_data, fd)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,9 @@ def main():
|
||||
|
||||
_yaml = YAML()
|
||||
_yaml.indent(mapping=2, sequence=4, offset=2)
|
||||
sys.stdout.write("# Auto-generated by otc_metadata.generate_docexports.data\n")
|
||||
sys.stdout.write(
|
||||
"# Auto-generated by otc_metadata.generate_docexports.data\n"
|
||||
)
|
||||
_yaml.dump(data.docs_html_by_category("internal"), sys.stdout)
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
import copy
|
||||
# import copy
|
||||
|
||||
import otc_metadata.services
|
||||
from ruamel.yaml import YAML
|
||||
# from ruamel.yaml import YAML
|
||||
|
||||
data = otc_metadata.services.Services()
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -15,15 +15,15 @@
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
# import os
|
||||
import pathlib
|
||||
import requests
|
||||
import subprocess
|
||||
import warnings
|
||||
# import warnings
|
||||
|
||||
from git import exc
|
||||
from git import Repo
|
||||
from git import SymbolicReference
|
||||
# from git import SymbolicReference
|
||||
|
||||
from ruamel.yaml import CommentedMap
|
||||
from ruamel.yaml import YAML
|
||||
@ -72,7 +72,7 @@ def process_repositories(args, service):
|
||||
workdir.mkdir(exist_ok=True)
|
||||
|
||||
copy_to = None
|
||||
repo_to = None
|
||||
# repo_to = None
|
||||
|
||||
for repo in service["repositories"]:
|
||||
logging.debug(f"Processing repository {repo}")
|
||||
@ -208,8 +208,7 @@ def process_repositories(args, service):
|
||||
project["check"]["jobs"].extend(
|
||||
[x["job"]["name"] for x in zuul_new_jobs])
|
||||
|
||||
|
||||
#yaml.indent(offset=2, sequence=2)
|
||||
# yaml.indent(offset=2, sequence=2)
|
||||
with open(zuul_file_name, "w") as f:
|
||||
yaml.dump(zuul_config, f)
|
||||
git_repo.index.add([zuul_file_name.name])
|
||||
@ -223,7 +222,8 @@ def process_repositories(args, service):
|
||||
git_repo.index.commit(
|
||||
(
|
||||
"Update zuul.yaml file\n\n"
|
||||
"Performed-by: gitea/infra/otc-metadata/tools/update_zuul_project_config.py"
|
||||
"Performed-by: gitea/infra/otc-metadata"
|
||||
"/tools/update_zuul_project_config.py"
|
||||
)
|
||||
)
|
||||
push_args = ["--set-upstream", "origin", branch_name]
|
||||
|
34
tox.ini
34
tox.ini
@ -1,56 +1,26 @@
|
||||
[tox]
|
||||
minversion = 3.2.0
|
||||
envlist = py39,pep8
|
||||
skipsdist = True
|
||||
envlist = py3,pep8
|
||||
ignore_basepython_conflict = true
|
||||
|
||||
|
||||
[testenv]
|
||||
basepython = python3
|
||||
usedevelop = True
|
||||
setenv =
|
||||
PYTHONWARNINGS=default::DeprecationWarning
|
||||
OS_STDOUT_CAPTURE=1
|
||||
OS_STDERR_CAPTURE=1
|
||||
OS_TEST_TIMEOUT=60
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands = stestr run {posargs}
|
||||
|
||||
[testenv:lower-constraints]
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:pep8]
|
||||
commands = flake8 {posargs}
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:cover]
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
PYTHON=coverage run --source otc_metadata --parallel-mode
|
||||
commands =
|
||||
stestr run {posargs}
|
||||
coverage combine
|
||||
coverage html -d cover
|
||||
coverage xml -o cover/coverage.xml
|
||||
|
||||
[testenv:docs]
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
commands = sphinx-build -W -b html doc/source doc/build/html
|
||||
|
||||
[testenv:releasenotes]
|
||||
deps = {[testenv:docs]deps}
|
||||
commands =
|
||||
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
[testenv:debug]
|
||||
commands = oslo_debug_helper {posargs}
|
||||
|
||||
[flake8]
|
||||
# E123, E125 skipped as they are invalid PEP-8.
|
||||
|
||||
show-source = True
|
||||
ignore = E123,E125
|
||||
ignore = E123,E125,W503
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||
|
10
zuul.yaml
10
zuul.yaml
@ -1,19 +1,11 @@
|
||||
- project:
|
||||
merge-mode: squash-merge
|
||||
default-branch: master
|
||||
templates:
|
||||
- publish-to-pypi
|
||||
- publish-otc-docs-hc-pti
|
||||
- release-notes-jobs
|
||||
default-branch: main
|
||||
check:
|
||||
jobs:
|
||||
- otc-tox-pep8
|
||||
- otc-tox-py38
|
||||
- otc-tox-py39
|
||||
- tox-functional
|
||||
gate:
|
||||
jobs:
|
||||
- otc-tox-pep8
|
||||
- otc-tox-py38
|
||||
- otc-tox-py39
|
||||
- tox-functional
|
||||
|
Loading…
x
Reference in New Issue
Block a user