mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
This pull request is complete implementation of IIAB Travis CI Testing for synatx errors, code linting and code review. Adds: Top level .travis.yml file. Add 'tests' directory with a 'inventory' and 'tests.yml' files. Modifies: roles/moodle/tasks/main.yml to fix ansible-lint parsing problem. Modifies: README.md to add Build status button This is Git squash of many commits. Please look at individual commit message for the content changes. Creating an initial travis testing based on Jeff geerlings testing ansible methodology https://www.jeffgeerling.com/blog/testing-ansible-roles-travis-ci-github Adding Ansible-lint, Ansible-review tests to travis Aded ansible-review for full repo and diff master Removing ansible-lint install step, it automatically installed by ansible-review Ansible-review only .yml files in root and roles, vars, tests folders Updated comments Corrected ansible-lint parameters Removed extranous tab that breaks ansible-lint Removed a tab character that causes problems with ansible-lint See https://github.com/willthames/ansible-lint/issues/166 Fixing Travis Ansible Syntax tests roles path The ansible roles path had problems due: 1. Absense of top level global role 'iiab' 2. Hardcoded paths '/etc/iiab' in ansible.cfg Fixing them in a hacky way. :( Adding Travis Build status to Readme file
42 lines
946 B
YAML
42 lines
946 B
YAML
---
|
|
language: python
|
|
python: "2.7"
|
|
|
|
# Use the new container infrastructure
|
|
sudo: false
|
|
|
|
# Install ansible
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- python-pip
|
|
|
|
install:
|
|
# Install ansible, ansible-lint and ansible-review
|
|
- pip install ansible
|
|
- pip install ansible-review
|
|
|
|
# Check ansible, version
|
|
- ansible --version
|
|
- ansible-lint --version
|
|
- ansible-review --version
|
|
|
|
# Create ansible.cfg with correct roles_path
|
|
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
|
|
|
script:
|
|
# Continuous integration: syntax check
|
|
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check -vvv
|
|
|
|
# Continous integration: ansible-list
|
|
- ansible-lint -p *yml
|
|
|
|
# Continous integration: ansible code review
|
|
- git ls-files *yml roles/ vars/ tests/ | xargs ansible-review
|
|
|
|
# Continouse integration: ansible code review of changes between master and current branch
|
|
- git diff master | ansible-review
|
|
|
|
|
|
#notifications:
|
|
# webhooks:
|