Add generic base and base-test jobs/playbooks
Start with a stripped-down fork of the base job from project-config, omitting any OpenStack-specific roles and variables. Also include a duplicate base-test job intended for testing out potential changes to the base job. Extend the linters env for tox to check the included playbooks with ansible-lint. Change-Id: I575be518c3e549a51c0c94deb295061dcf8be0b5
This commit is contained in:
parent
18245e1bf1
commit
a95beaf354
|
@ -0,0 +1,3 @@
|
|||
- hosts: all
|
||||
roles:
|
||||
- remove-build-sshkey
|
|
@ -0,0 +1,4 @@
|
|||
- hosts: all
|
||||
roles:
|
||||
- add-build-sshkey
|
||||
- prepare-workspace
|
|
@ -0,0 +1,3 @@
|
|||
- hosts: all
|
||||
roles:
|
||||
- remove-build-sshkey
|
|
@ -0,0 +1,4 @@
|
|||
- hosts: all
|
||||
roles:
|
||||
- add-build-sshkey
|
||||
- prepare-workspace
|
13
tox.ini
13
tox.ini
|
@ -22,8 +22,21 @@ commands = bindep test
|
|||
commands = python setup.py build_sphinx
|
||||
|
||||
[testenv:linters]
|
||||
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
|
||||
whitelist_externals = bash
|
||||
commands =
|
||||
flake8 {posargs}
|
||||
# Ansible lint
|
||||
# [ANSIBLE0012] Commands should not change things if nothing needs doing
|
||||
bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \
|
||||
xargs -t -n1 -0 ansible-lint -xANSIBLE0012"
|
||||
# Ansible Syntax Check
|
||||
bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
|
||||
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
- job:
|
||||
name: base
|
||||
parent: null
|
||||
description: |
|
||||
The recommended base job.
|
||||
|
||||
All jobs ultimately inherit from this. It runs a pre-playbook
|
||||
which copies all of the job's prepared git repos on to all of
|
||||
the nodes in the nodeset.
|
||||
|
||||
It also sets a default timeout value (which may be overidden).
|
||||
pre-run: playbooks/base/pre.yaml
|
||||
post-run: playbooks/base/post-ssh.yaml
|
||||
roles:
|
||||
- zuul: openstack-infra/zuul-jobs
|
||||
timeout: 1800
|
||||
|
||||
- job:
|
||||
name: base-test
|
||||
parent: null
|
||||
description: |
|
||||
A job to test changes to the base job without disturbing the
|
||||
main job in production. Not for general use.
|
||||
pre-run: playbooks/base-test/pre.yaml
|
||||
post-run: playbooks/base-test/post-ssh.yaml
|
||||
roles:
|
||||
- zuul: openstack-infra/zuul-jobs
|
||||
timeout: 1800
|
Loading…
Reference in New Issue