Add zuulv3 jobs

Update our role to use the latest syntax for running zuulv3 jobs.

Change-Id: Ie86749032fdf234d20553e318c51b817f8cabb42
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-05-10 13:31:30 -04:00
parent 886761040a
commit b8f4bdb685
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
8 changed files with 76 additions and 39 deletions

43
.zuul.yaml Normal file
View File

@ -0,0 +1,43 @@
- job:
name: ansible-role-nginx-base
run: tests/playbooks/run.yaml
roles:
- zuul: openstack/ansible-role-nginx
- job:
name: ansible-role-nginx
parent: ansible-role-nginx-base
- job:
name: ansible-role-nginx-fedora-27
parent: ansible-role-nginx
nodeset: fedora-27
- job:
name: ansible-role-nginx-ubuntu-bionic
parent: ansible-role-nginx
nodeset: ubuntu-bionic
- job:
name: ansible-role-nginx-ubuntu-xenial
parent: ansible-role-nginx
nodeset: ubuntu-xenial
- project:
name: openstack/ansible-role-nginx
templates:
- windmill-jobs-fedora-27
- windmill-jobs-bionic
- windmill-jobs-xenial
check:
jobs:
- ansible-role-nginx-fedora-27
- ansible-role-nginx-ubuntu-bionic
- ansible-role-nginx-ubuntu-xenial
- tox-linters
gate:
jobs:
- ansible-role-nginx-fedora-27
- ansible-role-nginx-ubuntu-bionic
- ansible-role-nginx-ubuntu-xenial
- tox-linters

7
doc/requirements.txt Normal file
View File

@ -0,0 +1,7 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# this is required for the docs build jobs
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
doc8>=0.6.0 # Apache-2.0

View File

@ -1 +1 @@
ansible ansible>=2.4.0

View File

@ -1,3 +1,2 @@
ansible-lint ansible-lint
hacking<0.11,>=0.10 hacking<0.11,>=0.10
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3

View File

@ -1,2 +0,0 @@
[defaults]
roles_path = ../..

View File

@ -1,2 +1 @@
[all]
localhost localhost

View File

@ -1,4 +1,4 @@
# Copyright 2015 Red Hat, Inc. # Copyright 2018 Red Hat, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -12,16 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
--- ---
- hosts: localhost - hosts: all
vars: vars:
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}" rolename: ansible-role-nginx
pre_tasks:
# Make sure OS does not have a stale package cache.
- name: Update apt cache.
become: yes
apt:
update_cache: yes
when: ansible_os_family == 'Debian'
roles: roles:
- "{{ rolename }}" - "{{ rolename }}"

46
tox.ini
View File

@ -8,30 +8,13 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
[testenv:docs] [testenv:docs]
commands = python setup.py build_sphinx deps = -r{toxinidir}/doc/requirements.txt
whitelist_externals =
[testenv:functional] bash
commands = commands=
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI. bash -c "rm -rf doc/build"
ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER} doc8 doc
passenv = sphinx-build -b html doc/source doc/build/html
HOME
USER
setenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
PYTHONUNBUFFERED = 1
[testenv:linters]
setenv =
ANSIBLE_CONFIG = tests/ansible.cfg
whitelist_externals = bash
commands =
flake8
bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint"
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory \
-e rolename=$(basename $(pwd)) > /dev/null"
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
@ -43,3 +26,18 @@ show-source = True
ignore = E123,E125 ignore = E123,E125
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:linters]
setenv =
ANSIBLE_ROLES_PATH = ..
whitelist_externals = bash
commands =
# PEP8 Lint Check
flake8
# Ansible Lint Check
bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \
xargs -t -n1 -0 ansible-lint"
# Ansible Syntax Check
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory \
-e rolename=$(basename $(pwd)) > /dev/null"