Add generic tox job (multiple playbooks)
Here we now support 3 tox jobs; cover, linters and py27. As you can see by looking at the code, we are not defining any variables (vars) in .zuul.yaml. This means, we create 3 separate playbooks (tox-cover.yaml, tox-py27, tox-linters.yaml) which then contain the variables we need for our tox role. Change-Id: I42f8855f44da51cb3d23f1825bd3258937543b2f Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
32
.zuul.yaml
32
.zuul.yaml
@@ -1,15 +1,37 @@
|
||||
- job:
|
||||
name: python-linters
|
||||
pre-run: pre
|
||||
post-run: post
|
||||
name: base
|
||||
pre-run: base-pre
|
||||
post-run: base-post
|
||||
success-url: http://zuulv3-dev.openstack.org/logs/{build.uuid}/
|
||||
failure-url: http://zuulv3-dev.openstack.org/logs/{build.uuid}/
|
||||
timeout: 1800
|
||||
nodes:
|
||||
- name: worker
|
||||
- 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
|
||||
voting: false
|
||||
|
||||
- job:
|
||||
name: tox-linters
|
||||
parent: tox
|
||||
|
||||
- job:
|
||||
name: tox-py27
|
||||
parent: tox
|
||||
|
||||
- project:
|
||||
name: openstack-infra/zuul
|
||||
check:
|
||||
jobs:
|
||||
- python-linters
|
||||
- tox-cover
|
||||
- tox-linters
|
||||
- tox-py27
|
||||
|
||||
@@ -6,13 +6,7 @@
|
||||
mode: pull
|
||||
src: "/tmp/console.log"
|
||||
|
||||
- name: Collect tox logs.
|
||||
synchronize:
|
||||
dest: "{{ zuul.launcher.log_root }}/tox"
|
||||
mode: pull
|
||||
src: "/home/zuul/workspace/src/{{ zuul.project }}/.tox/pep8/log/"
|
||||
|
||||
- name: publish tox logs.
|
||||
- name: Publish logs.
|
||||
copy:
|
||||
dest: "/opt/zuul-logs/{{ zuul.uuid}}"
|
||||
src: "{{ zuul.launcher.log_root }}/"
|
||||
@@ -1,7 +0,0 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Run a tox -e pep8.
|
||||
include_role:
|
||||
name: run-tox
|
||||
vars:
|
||||
run_tox_eventlist: pep8
|
||||
5
playbooks/roles/run-bindep/tasks/main.yaml
Normal file
5
playbooks/roles/run-bindep/tasks/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Run install-distro-packages.sh
|
||||
shell: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
|
||||
args:
|
||||
chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
|
||||
@@ -1,3 +1,2 @@
|
||||
---
|
||||
# tasks/main.yaml
|
||||
run_tox_eventlist:
|
||||
run_tox_envlist:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
- name: Run tox
|
||||
shell: "/usr/local/jenkins/slave_scripts/run-tox.sh {{ run_tox_eventlist }}"
|
||||
shell: "/usr/local/jenkins/slave_scripts/run-tox.sh {{ run_tox_envlist }}"
|
||||
args:
|
||||
chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
|
||||
|
||||
5
playbooks/tox-cover.yaml
Normal file
5
playbooks/tox-cover.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- hosts: all
|
||||
vars:
|
||||
run_tox_envlist: cover
|
||||
roles:
|
||||
- run-tox
|
||||
5
playbooks/tox-linters.yaml
Normal file
5
playbooks/tox-linters.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- hosts: all
|
||||
vars:
|
||||
run_tox_envlist: pep8
|
||||
roles:
|
||||
- run-tox
|
||||
17
playbooks/tox-post.yaml
Normal file
17
playbooks/tox-post.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Find tox directories to synchrionize.
|
||||
find:
|
||||
file_type: directory
|
||||
paths: "/home/zuul/workspace/src/{{ zuul.project }}/.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.launcher.log_root }}/tox"
|
||||
mode: pull
|
||||
src: "{{ item.path }}/log/"
|
||||
with_items: "{{ result.files }}"
|
||||
3
playbooks/tox-pre.yaml
Normal file
3
playbooks/tox-pre.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- run-bindep
|
||||
5
playbooks/tox-py27.yaml
Normal file
5
playbooks/tox-py27.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- hosts: all
|
||||
vars:
|
||||
run_tox_envlist: py27
|
||||
roles:
|
||||
- run-tox
|
||||
Reference in New Issue
Block a user