Merge "Plumb job variables through to ansible" into feature/zuulv3
diff --git a/.zuul.yaml b/.zuul.yaml
new file mode 100644
index 0000000..db03673
--- /dev/null
+++ b/.zuul.yaml
@@ -0,0 +1,13 @@
+- job:
+ name: python-linters
+ pre-run: pre
+ post-run: post
+ nodes:
+ - name: worker
+ image: ubuntu-xenial
+
+- project:
+ name: openstack-infra/zuul
+ check:
+ jobs:
+ - python-linters
diff --git a/playbooks/post.yaml b/playbooks/post.yaml
new file mode 100644
index 0000000..31570bc
--- /dev/null
+++ b/playbooks/post.yaml
@@ -0,0 +1,14 @@
+- hosts: all
+ tasks:
+ - name: Collect console log.
+ synchronize:
+ dest: "{{ zuul.launcher.log_root }}"
+ 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/"
+
diff --git a/playbooks/pre.yaml b/playbooks/pre.yaml
new file mode 100644
index 0000000..1a2e699
--- /dev/null
+++ b/playbooks/pre.yaml
@@ -0,0 +1,3 @@
+- hosts: all
+ roles:
+ - prepare-workspace
diff --git a/playbooks/python-linters.yaml b/playbooks/python-linters.yaml
new file mode 100644
index 0000000..bc7effe
--- /dev/null
+++ b/playbooks/python-linters.yaml
@@ -0,0 +1,7 @@
+- hosts: all
+ tasks:
+ - name: Run a tox -e pep8.
+ include_role:
+ name: run-tox
+ vars:
+ run_tox_eventlist: pep8
diff --git a/playbooks/roles/prepare-workspace/defaults/main.yaml b/playbooks/roles/prepare-workspace/defaults/main.yaml
new file mode 100644
index 0000000..9127ad8
--- /dev/null
+++ b/playbooks/roles/prepare-workspace/defaults/main.yaml
@@ -0,0 +1,3 @@
+---
+# tasks/main.yaml
+prepare_workspace_root: /home/zuul/workspace
diff --git a/playbooks/roles/prepare-workspace/tasks/main.yaml b/playbooks/roles/prepare-workspace/tasks/main.yaml
new file mode 100644
index 0000000..76f9d95
--- /dev/null
+++ b/playbooks/roles/prepare-workspace/tasks/main.yaml
@@ -0,0 +1,21 @@
+- name: Ensure console.log does not exist.
+ file:
+ path: /tmp/console.log
+ state: absent
+
+- name: Start zuul_console daemon.
+ zuul_console:
+ path: /tmp/console.log
+ port: 19885
+
+- name: Create workspace directory.
+ file:
+ path: "{{ prepare_workspace_root }}"
+ owner: zuul
+ group: zuul
+ state: directory
+
+- name: Synchronize src repos to workspace directory.
+ synchronize:
+ dest: "{{ prepare_workspace_root }}"
+ src: "{{ zuul.launcher.src_root }}"
diff --git a/playbooks/roles/run-tox/defaults/main.yaml b/playbooks/roles/run-tox/defaults/main.yaml
new file mode 100644
index 0000000..7f0310c
--- /dev/null
+++ b/playbooks/roles/run-tox/defaults/main.yaml
@@ -0,0 +1,3 @@
+---
+# tasks/main.yaml
+run_tox_eventlist:
diff --git a/playbooks/roles/run-tox/tasks/main.yaml b/playbooks/roles/run-tox/tasks/main.yaml
new file mode 100644
index 0000000..ca8d079
--- /dev/null
+++ b/playbooks/roles/run-tox/tasks/main.yaml
@@ -0,0 +1,4 @@
+- name: Run tox
+ shell: "/usr/local/jenkins/slave_scripts/run-tox.sh {{ run_tox_eventlist }}"
+ args:
+ chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
diff --git a/tools/update-storyboard.py b/tools/update-storyboard.py
index 6800a35..12e6916 100644
--- a/tools/update-storyboard.py
+++ b/tools/update-storyboard.py
@@ -67,6 +67,7 @@
'inprogress': ['In Progress', 'Blocked'],
'review': ['In Progress', 'Blocked'],
'merged': None,
+ 'invalid': None,
}