.travis.yml 970 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. language: python
  3. python: "2.7"
  4. env:
  5. - SITE=test.yml
  6. before_install:
  7. - sudo apt-get update -qq
  8. install:
  9. # Install Ansible.
  10. - pip install ansible
  11. # Add ansible.cfg to pick up roles path.
  12. - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
  13. # Install required dependencies.
  14. - ansible-galaxy install geerlingguy.git
  15. script:
  16. # Check the role/playbook's syntax.
  17. - "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
  18. # Run the role/playbook with ansible-playbook.
  19. - "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
  20. # Run the role/playbook again, checking to make sure it's idempotent.
  21. - >
  22. ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
  23. | grep -q 'changed=0.*failed=0'
  24. && (echo 'Idempotence test: pass' && exit 0)
  25. || (echo 'Idempotence test: fail' && exit 1)
  26. # Check if we get an installation page.
  27. - curl http://localhost:3000/install