Add travis-ci
This commit is contained in:
43
.travis.yml
Normal file
43
.travis.yml
Normal 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)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
## What is ansible-ruby?
|
## What is ansible-ruby? [](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.
|
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
1
tests/inventory
Normal file
@@ -0,0 +1 @@
|
|||||||
|
localhost
|
||||||
10
tests/test_home.yml
Normal file
10
tests/test_home.yml
Normal 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
7
tests/test_system.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
remote_user: travis
|
||||||
|
sudo: true
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- ansible-ruby
|
||||||
Reference in New Issue
Block a user