Browse Source

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>
changes/52/567652/1
Paul Belanger 4 years ago
parent
commit
b8f4bdb685
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
  1. 43
      .zuul.yaml
  2. 7
      doc/requirements.txt
  3. 2
      requirements.txt
  4. 1
      test-requirements.txt
  5. 2
      tests/ansible.cfg
  6. 1
      tests/inventory
  7. 13
      tests/playbooks/run.yaml
  8. 46
      tox.ini

43
.zuul.yaml

@ -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

@ -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

2
requirements.txt

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

1
test-requirements.txt

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

2
tests/ansible.cfg

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

1
tests/inventory

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

13
tests/test.yaml → tests/playbooks/run.yaml

@ -1,4 +1,4 @@
# Copyright 2015 Red Hat, Inc.
# Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (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
# under the License.
---
- hosts: localhost
- hosts: all
vars:
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
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'
rolename: ansible-role-nginx
roles:
- "{{ rolename }}"

46
tox.ini

@ -8,30 +8,13 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:functional]
commands =
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER}
passenv =
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"
deps = -r{toxinidir}/doc/requirements.txt
whitelist_externals =
bash
commands=
bash -c "rm -rf doc/build"
doc8 doc
sphinx-build -b html doc/source doc/build/html
[testenv:venv]
commands = {posargs}
@ -43,3 +26,18 @@ show-source = True
ignore = E123,E125
builtins = _
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"

Loading…
Cancel
Save