Create openstack-zuul-jobs-linters jobs
This will be a cross repo linter jobs for openstack-zuul-jobs, project-config and zuul-jobs. Each repo will be able to run this job, which sets up all our projects roles in the correct locations. Depends-On: I59e5d41a9539671ee5aab9b9036379eb9101d021 Change-Id: I16186c929e7d0e6e34b35271559e555255a52b00 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
c9917b2200
commit
f769c9d0f4
@ -8,6 +8,3 @@ ansible<2.4.0
|
|||||||
ansible-lint
|
ansible-lint
|
||||||
bashate>=0.2
|
bashate>=0.2
|
||||||
zuul-sphinx>=0.2.0
|
zuul-sphinx>=0.2.0
|
||||||
|
|
||||||
# zuul-jobs is required to supply the ansible roles for ansible-lint
|
|
||||||
-e git://git.openstack.org/openstack-infra/zuul-jobs#egg=zuul-jobs
|
|
||||||
|
12
tox.ini
12
tox.ini
@ -22,11 +22,19 @@ commands = bindep test
|
|||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
setenv =
|
|
||||||
ANSIBLE_ROLES_PATH = {toxinidir}/roles:{envdir}/src/zuul-jobs/roles
|
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
|
passenv =
|
||||||
|
# NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need
|
||||||
|
# to export ANSIBLE_ROLES_PATH pointing to the currect repos.
|
||||||
|
# see infra-zuul-jobs-linters job for more information.
|
||||||
|
ANSIBLE_ROLES_PATH
|
||||||
commands =
|
commands =
|
||||||
flake8 {posargs}
|
flake8 {posargs}
|
||||||
|
# Ansible lint
|
||||||
|
# [ANSIBLE0012] Commands should not change things if nothing needs doing
|
||||||
|
bash -c "find playbooks -type d -name "legacy" -prune -o \
|
||||||
|
-type f -regex '.*.y[a]ml' -print0 | xargs -t -n1 -0 \
|
||||||
|
ansible-lint -xANSIBLE0012"
|
||||||
# Ansible Syntax Check
|
# Ansible Syntax Check
|
||||||
bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \
|
bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \
|
||||||
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
||||||
|
@ -770,3 +770,18 @@
|
|||||||
parent: legacy-base
|
parent: legacy-base
|
||||||
required-projects:
|
required-projects:
|
||||||
- openstack/requirements
|
- openstack/requirements
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-zuul-jobs-linters
|
||||||
|
parent: tox
|
||||||
|
description: |
|
||||||
|
This job runs against project-config, openstack-zuul-jobs and zuul-jobs
|
||||||
|
so we can properly lint our ansible playbooks / roles
|
||||||
|
required-projects:
|
||||||
|
- openstack-infra/openstack-zuul-jobs
|
||||||
|
- openstack-infra/project-config
|
||||||
|
- openstack-infra/zuul-jobs
|
||||||
|
vars:
|
||||||
|
tox_envlist: linters
|
||||||
|
tox_environment:
|
||||||
|
ANSIBLE_ROLES_PATH: ~/src/git.openstack.org/openstack-infra/zuul-jobs/roles:~/src/git.openstack.org/openstack-infra/openstack-zuul-jobs/roles:~/src/git.openstack.org/openstack-infra/project-config/roles
|
||||||
|
@ -17,9 +17,8 @@
|
|||||||
- multinode-integration-ubuntu-xenial
|
- multinode-integration-ubuntu-xenial
|
||||||
- multinode-integration-opensuse423
|
- multinode-integration-opensuse423
|
||||||
- build-openstack-sphinx-docs
|
- build-openstack-sphinx-docs
|
||||||
- tox-linters:
|
- openstack-zuul-jobs-linters:
|
||||||
required-projects:
|
voting: false
|
||||||
- openstack-infra/zuul-jobs
|
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- base-integration-centos-7
|
- base-integration-centos-7
|
||||||
@ -34,6 +33,3 @@
|
|||||||
- multinode-integration-ubuntu-xenial
|
- multinode-integration-ubuntu-xenial
|
||||||
- multinode-integration-opensuse423
|
- multinode-integration-opensuse423
|
||||||
- build-openstack-sphinx-docs
|
- build-openstack-sphinx-docs
|
||||||
- tox-linters:
|
|
||||||
required-projects:
|
|
||||||
- openstack-infra/zuul-jobs
|
|
||||||
|
Loading…
Reference in New Issue
Block a user