Skip to content

Commit

Permalink
Add tox ansible-lint, docs and jjb gate jobs
Browse files Browse the repository at this point in the history
Change-Id: I6212e327367e468f0b7bc7fc84983b519a9588df
  • Loading branch information
David Moreau Simard committed Dec 6, 2015
1 parent 3f2cce7 commit 839b8a2
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 7 deletions.
23 changes: 22 additions & 1 deletion jenkins/jobs/builders.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- builder:
name: 'weirdo-gate-builder'
name: 'weirdo-gate-ansible'
builders:
- shining-panda:
build-environment: 'virtualenv'
Expand All @@ -26,6 +26,27 @@
exit $result
- builder:
name: 'weirdo-gate-tox'
builders:
- shining-panda:
build-environment: 'virtualenv'
python-version: 'system-CPython-2.7'
nature: 'shell'
clear: true
use-distribute: false
system-site-packages: false
ignore-exit-code: false
command: |
# Ensure tox is installed
pip install tox
# Run {test} from provided jenkins scm gerrit commit ref
pushd weirdo
tox -e {test}
result=$?
exit $result
- builder:
name: 'weirdo-periodic-builder'
builders:
Expand Down
13 changes: 11 additions & 2 deletions jenkins/jobs/main.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
- project:
name: 'weirdo-gate-jobs'
name: 'weirdo-gate-ansible-jobs'
playbook:
- 'puppet-openstack-scenario001'
- 'puppet-openstack-scenario002'
- 'kolla-build-centos-binary'
- 'kolla-deploy-centos-binary'
jobs:
- weirdo-gate-{playbook}
- weirdo-gate-ansible-{playbook}

- project:
name: 'weirdo-gate-tox-jobs'
test:
- 'ansible-lint'
- 'docs'
- 'jjb'
jobs:
- weirdo-gate-tox-{test}

- project:
name: 'weirdo-periodic-jobs'
Expand Down
38 changes: 35 additions & 3 deletions jenkins/jobs/templates.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- job-template:
name: 'weirdo-gate-{playbook}'
name: 'weirdo-gate-ansible-{playbook}'
defaults: 'weirdo-defaults'
description: |
<p>Managed by Jenkins Job Builder. Do not edit via web.</p>
Expand All @@ -18,7 +18,7 @@
pip install -e git+https://github.com/ansible/ansible.git@v2.0.0-0.6.rc1#egg=ansible
# Setup ansible config and run the playbook
pushd $VIRTUALN_ENV/usr/local/share/weirdo
pushd $VIRTUAL_ENV/usr/local/share/weirdo
mv ansible.cfg.example ansible.cfg
ansible-playbook -vv playbooks/{playbook}.yml
result=$?
Expand All @@ -31,14 +31,46 @@
scm:
- weirdo-gate-repository
builders:
- weirdo-gate-builder:
- weirdo-gate-ansible:
playbook: '{playbook}'
properties:
- ownership:
owner: dms@redhat.com
publishers:
- email-cores

- job-template:
name: 'weirdo-gate-tox-{test}'
defaults: 'weirdo-defaults'
description: |
<p>Managed by Jenkins Job Builder. Do not edit via web.</p>
<br>
<p>This job gates against commits done to <a href="https://github.com/redhat-openstack/weirdo" target="_blank">WeIRDO</a>.</p>
<p>It leverages tox for testing.</p>
<br>
This is what this job runs:
<pre>
# Run {test} from provided jenkins scm gerrit commit ref
pushd weirdo
tox -e {test}
result=$?
exit $result
</pre>
triggers:
- weirdo-gate-trigger
scm:
- weirdo-gate-repository
builders:
- weirdo-gate-tox:
test: '{test}'
properties:
- ownership:
owner: dms@redhat.com
publishers:
- email-cores


- job-template:
name: 'weirdo-periodic-{playbook}'
defaults: 'weirdo-defaults'
Expand Down
3 changes: 2 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ sphinx
sphinx-rtd-theme
ansible
ansible-lint
graphviz
graphviz
jenkins-job-builder
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ commands = python setup.py build_sphinx
[testenv:ansible-lint]
whitelist_externals = bash
commands = bash -c "for file in $(ls {toxinidir}/playbooks/*.yml); do ansible-lint $file; done"

[testenv:jjb]
commands = jenkins-jobs test {toxinidir}/jenkins/jobs

0 comments on commit 839b8a2

Please sign in to comment.