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:
Paul Belanger 2017-10-17 12:51:21 -04:00 committed by Andreas Jaeger
parent c9917b2200
commit f769c9d0f4
4 changed files with 27 additions and 11 deletions

View File

@ -8,6 +8,3 @@ ansible<2.4.0
ansible-lint
bashate>=0.2
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
View File

@ -22,11 +22,19 @@ commands = bindep test
commands = python setup.py build_sphinx
[testenv:linters]
setenv =
ANSIBLE_ROLES_PATH = {toxinidir}/roles:{envdir}/src/zuul-jobs/roles
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 =
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
bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"

View File

@ -770,3 +770,18 @@
parent: legacy-base
required-projects:
- 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

View File

@ -17,9 +17,8 @@
- multinode-integration-ubuntu-xenial
- multinode-integration-opensuse423
- build-openstack-sphinx-docs
- tox-linters:
required-projects:
- openstack-infra/zuul-jobs
- openstack-zuul-jobs-linters:
voting: false
gate:
jobs:
- base-integration-centos-7
@ -34,6 +33,3 @@
- multinode-integration-ubuntu-xenial
- multinode-integration-opensuse423
- build-openstack-sphinx-docs
- tox-linters:
required-projects:
- openstack-infra/zuul-jobs