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
@@ -1,5 +1,5 @@
- builder: - builder:
name: 'weirdo-gate-builder' name: 'weirdo-gate-ansible'
builders: builders:
- shining-panda: - shining-panda:
build-environment: 'virtualenv' build-environment: 'virtualenv'
Expand All @@ -26,6 +26,27 @@
exit $result 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: - builder:
name: 'weirdo-periodic-builder' name: 'weirdo-periodic-builder'
builders: builders:
Expand Down
13 changes: 11 additions & 2 deletions jenkins/jobs/main.yaml
@@ -1,12 +1,21 @@
- project: - project:
name: 'weirdo-gate-jobs' name: 'weirdo-gate-ansible-jobs'
playbook: playbook:
- 'puppet-openstack-scenario001' - 'puppet-openstack-scenario001'
- 'puppet-openstack-scenario002' - 'puppet-openstack-scenario002'
- 'kolla-build-centos-binary' - 'kolla-build-centos-binary'
- 'kolla-deploy-centos-binary' - 'kolla-deploy-centos-binary'
jobs: 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: - project:
name: 'weirdo-periodic-jobs' name: 'weirdo-periodic-jobs'
Expand Down
38 changes: 35 additions & 3 deletions jenkins/jobs/templates.yaml
@@ -1,5 +1,5 @@
- job-template: - job-template:
name: 'weirdo-gate-{playbook}' name: 'weirdo-gate-ansible-{playbook}'
defaults: 'weirdo-defaults' defaults: 'weirdo-defaults'
description: | description: |
<p>Managed by Jenkins Job Builder. Do not edit via web.</p> <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 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 # 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 mv ansible.cfg.example ansible.cfg
ansible-playbook -vv playbooks/{playbook}.yml ansible-playbook -vv playbooks/{playbook}.yml
result=$? result=$?
Expand All @@ -31,14 +31,46 @@
scm: scm:
- weirdo-gate-repository - weirdo-gate-repository
builders: builders:
- weirdo-gate-builder: - weirdo-gate-ansible:
playbook: '{playbook}' playbook: '{playbook}'
properties: properties:
- ownership: - ownership:
owner: dms@redhat.com owner: dms@redhat.com
publishers: publishers:
- email-cores - 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: - job-template:
name: 'weirdo-periodic-{playbook}' name: 'weirdo-periodic-{playbook}'
defaults: 'weirdo-defaults' defaults: 'weirdo-defaults'
Expand Down
3 changes: 2 additions & 1 deletion test-requirements.txt
Expand Up @@ -2,4 +2,5 @@ sphinx
sphinx-rtd-theme sphinx-rtd-theme
ansible ansible
ansible-lint ansible-lint
graphviz graphviz
jenkins-job-builder
3 changes: 3 additions & 0 deletions tox.ini
Expand Up @@ -15,3 +15,6 @@ commands = python setup.py build_sphinx
[testenv:ansible-lint] [testenv:ansible-lint]
whitelist_externals = bash whitelist_externals = bash
commands = bash -c "for file in $(ls {toxinidir}/playbooks/*.yml); do ansible-lint $file; done" 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.