Import playbooks from feature/zuulv3 development

We have been using the following ansible playbooks for testing
feature/zuulv3 of zuul.  This commit copies the playbooks from zuul
and imports them here.

Change-Id: Ib776cdce10b1f05501c46f6cf359723960f1bc71
Depends-On: I11da723df8823091f25e2a630e80ee4270d99a9b
Depends-On: Ic03634dd02d2eb1fa5aa8a38f4beb5f0ec5582c6
Co-Authored-By: Andreas Jaeger <aj@suse.com>
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-05-03 19:25:24 +02:00
parent f72dc58cc2
commit c5e55d75b3
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
13 changed files with 155 additions and 1 deletions

View File

@ -1,5 +1,53 @@
- job:
name: base
pre-run: base/pre
post-run: base/post
roles:
- zuul: openstack-infra/openstack-zuul-roles
success-url: http://zuulv3-dev.openstack.org/logs/{build.uuid}/
failure-url: http://zuulv3-dev.openstack.org/logs/{build.uuid}/
timeout: 1800
vars:
zuul_workspace_root: /home/zuul
nodes:
- name: ubuntu-xenial
image: ubuntu-xenial
- job:
name: tox
parent: base
pre-run: tox/pre
post-run: tox/post
- job:
name: tox-cover
parent: tox
run: tox/cover
voting: false
- job:
name: tox-docs
parent: tox
run: tox/docs
- job:
name: tox-linters
parent: tox
run: tox/linters
- job:
name: tox-py27
parent: tox
run: tox/py27
- job:
name: tox-tarball
parent: tox
run: tox/tarball
post-run: tox/tarball-post
- project:
name: openstack-infra/openstack-zuul-jobs
check:
jobs:
- noop
- tox-linters

13
playbooks/base/post.yaml Normal file
View File

@ -0,0 +1,13 @@
- hosts: all
tasks:
- name: Collect console log.
synchronize:
dest: "{{ zuul.executor.log_root }}"
mode: pull
src: "/tmp/console.log"
- name: Publish logs.
copy:
dest: "/opt/zuul-logs/{{ zuul.uuid}}"
src: "{{ zuul.executor.log_root }}/"
delegate_to: 127.0.0.1

3
playbooks/base/pre.yaml Normal file
View File

@ -0,0 +1,3 @@
- hosts: all
roles:
- prepare-workspace

5
playbooks/tox/cover.yaml Normal file
View File

@ -0,0 +1,5 @@
- hosts: all
roles:
- extra-test-setup
- revoke-sudo
- run-cover

4
playbooks/tox/docs.yaml Normal file
View File

@ -0,0 +1,4 @@
- hosts: all
roles:
- revoke-sudo
- run-docs

View File

@ -0,0 +1,6 @@
- hosts: all
vars:
run_tox_envlist: pep8
roles:
- revoke-sudo
- run-tox

17
playbooks/tox/post.yaml Normal file
View File

@ -0,0 +1,17 @@
- hosts: all
tasks:
- name: Find tox directories to synchrionize.
find:
file_type: directory
paths: "{{ zuul_workspace_root }}/src/{{ zuul.project.canonical_name }}/.tox"
# NOTE(pabelanger): The .tox/log folder is empty, ignore it.
patterns: ^(?!log).*$
use_regex: yes
register: result
- name: Collect tox logs.
synchronize:
dest: "{{ zuul.executor.log_root }}/tox"
mode: pull
src: "{{ item.path }}/log/"
with_items: "{{ result.files }}"

3
playbooks/tox/pre.yaml Normal file
View File

@ -0,0 +1,3 @@
- hosts: all
roles:
- run-bindep

7
playbooks/tox/py27.yaml Normal file
View File

@ -0,0 +1,7 @@
- hosts: all
vars:
run_tox_envlist: py27
roles:
- extra-test-setup
- revoke-sudo
- run-tox

View File

@ -0,0 +1,10 @@
- hosts: all
tasks:
- name: Collect tarball artifacts.
synchronize:
dest: "{{ zuul.executor.src_root }}/tarballs"
mode: pull
src: "{{ zuul_workspace_root }}/src/{{ zuul.project.canonical_name }}/dist/{{ item }}"
with_items:
- "*.tar.gz"
- "*.whl"

View File

@ -0,0 +1,5 @@
- hosts: all
roles:
- revoke-sudo
- run-tarball
- run-wheel

2
test-requirements.txt Normal file
View File

@ -0,0 +1,2 @@
hacking>=0.10,<0.11
bashate>=0.2

31
tox.ini Normal file
View File

@ -0,0 +1,31 @@
[tox]
minversion = 1.6
skipsdist = True
envlist = pep8, py27
[testenv]
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
commands =
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:pep8]
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
[flake8]
# These are ignored intentionally in openstack-infra projects;
# please don't submit patches that solely correct them or enable them.
ignore = E125,E129,H
show-source = True
exclude = .venv,.tox,dist,doc,build,*.egg