Add travis-ci

This commit is contained in:
Nick Janetakis
2014-06-23 12:44:01 -04:00
parent b7c771a1ce
commit c4fd0c17b8
5 changed files with 62 additions and 1 deletions

43
.travis.yml Normal file
View File

@@ -0,0 +1,43 @@
---
language: "python"
python: "2.7"
env:
- SITE_SYSTEM_AND_INVENTORY="tests/test_system.yml -i tests/inventory"
- SITE_HOME_AND_INVENTORY="tests/test_home.yml -i tests/inventory"
before_install:
- "rvm implode"
- "rm -rf /home/travis/.rvm"
install:
- "pip install ansible==1.6.2"
- "printf '[defaults]\nroles_path = ../' > ansible.cfg"
script:
- "ansible-playbook $SITE_SYSTEM_AND_INVENTORY --syntax-check"
- "ansible-playbook $SITE_SYSTEM_AND_INVENTORY --connection=local -vvvv"
- >
ansible-playbook $SITE_SYSTEM_AND_INVENTORY --connection=local
| grep -q 'changed=2.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- >
ruby -v
| grep -q 'ruby'
&& (echo 'Version test: pass' && exit 0)
|| (echo 'Version test: fail' && exit 1)
- "rvm implode"
- "rm -rf /home/travis/.rvm"
- "ansible-playbook $SITE_HOME_AND_INVENTORY --syntax-check"
- "ansible-playbook $SITE_HOME_AND_INVENTORY --connection=local -vvvv"
- >
ansible-playbook $SITE_HOME_AND_INVENTORY --connection=local
| grep -q 'changed=2.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- >
ruby -v
| grep -q 'ruby'
&& (echo 'Version test: pass' && exit 0)
|| (echo 'Version test: fail' && exit 1)

View File

@@ -1,4 +1,4 @@
## What is ansible-ruby?
## What is ansible-ruby? [![Build Status](https://secure.travis-ci.org/nickjj/ansible-ruby.png)](http://travis-ci.org/nickjj/ansible-ruby)
It is an [ansible](http://www.ansible.com/home) role to install a specific version of ruby without having to compile ruby on the machine you're setting up. It does this by using rvm under the hood.

1
tests/inventory Normal file
View File

@@ -0,0 +1 @@
localhost

10
tests/test_home.yml Normal file
View File

@@ -0,0 +1,10 @@
---
- hosts: localhost
remote_user: travis
sudo: true
vars:
ruby_temp_download_path: /home/travis/tmp
ruby_rvm_install_path: /home/travis/.rmv
roles:
- ansible-ruby

7
tests/test_system.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- hosts: localhost
remote_user: travis
sudo: true
roles:
- ansible-ruby