From 25c96d7d55c71310df55746c3d360cd68bd89cd2 Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Tue, 14 Mar 2023 20:11:32 +0100 Subject: [PATCH] initial import --- README.md | 1 - linters-requirements.txt | 4 ++++ setup.cfg | 13 +++++++++++++ setup.py | 17 ++++++++++++++++ tox.ini | 42 ++++++++++++++++++++++++++++++++++++++++ zuul/main.yaml | 30 ++++++++++++++++++++++++++++ 6 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 linters-requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 tox.ini create mode 100644 zuul/main.yaml diff --git a/README.md b/README.md index 44efa20..41e46fd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ # project-config - diff --git a/linters-requirements.txt b/linters-requirements.txt new file mode 100644 index 0000000..d88026f --- /dev/null +++ b/linters-requirements.txt @@ -0,0 +1,4 @@ +# linters have different requirements than test ones, some would +# conflict, like ansible version required by ansible-lint. +flake8 +yamllint>=1.23.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..28adcd9 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,13 @@ +[metadata] +name = scs-zuul-config +summary = Zuul configuration for the SCS on OTC +description_file = + README.rst +author = OpenTelekomCloud Eco Infrastructure Team +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c232273 --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +# 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. + +import setuptools + +setuptools.setup( + setup_requires=['pbr>=2.0'], + pbr=True) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..9313616 --- /dev/null +++ b/tox.ini @@ -0,0 +1,42 @@ +[tox] +minversion = 1.6 +envlist = linters +skipsdist = True + +[testenv] +passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY +basepython = python3 + +[testenv:linters] +whitelist_externals = bash +setenv = + +# Add dependencies here since other jobs use python2 and zuul requires +# python3. +deps = + -r{toxinidir}/linters-requirements.txt +commands = + flake8 {posargs} + yamllint -s -f parsable . + +[testenv:venv] +commands = {posargs} + +[flake8] +ignore = E124,E125,E129,E252,E402,E741,E501,W503,W504,H +show-source = True +exclude = + .venv, + .tox, + dist, + doc, + build, + *.egg, + +[testenv:bindep] +# Do not install any requirements. We want this to be fast and work even if +# system dependencies are missing, since it's used to tell you what system +# dependencies are missing! This also means that bindep must be installed +# separately, outside of the requirements files. +deps = bindep +commands = bindep test diff --git a/zuul/main.yaml b/zuul/main.yaml new file mode 100644 index 0000000..cfa9aff --- /dev/null +++ b/zuul/main.yaml @@ -0,0 +1,30 @@ +- admin-rule: + name: admin + conditions: + - resource_access.zuul.roles: "admin" + +- admin-rule: + name: scs_admin + conditions: + - resource_access.zuul.roles: "scs_admin" + +- tenant: + name: scs + admin-rules: + - admin + - scs_admin + exclude-unprotected-branches: true + report-build-page: true + max-nodes-per-job: 5 + source: + gitea: + config-project: + - scs/project-config + - scs/base-jobs + untrusted-projects: + + opendev: + untrusted-projects: + - zuul/zuul-jobs: + shadow: + - scs/project-config