Skip to content

Commit dc0eba2

Browse files
committed
Add Travis CI test integration.
1 parent a7998b3 commit dc0eba2

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
- pip install ansible==1.5.0
10+
script:
11+
# Check the role/playbook's syntax.
12+
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
13+
14+
# Run the role/playbook with ansible-playbook.
15+
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
16+
17+
# Run the role/playbook again, checking to make sure it's idempotent.
18+
- >
19+
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
20+
| grep -q 'changed=0.*failed=0'
21+
&& (echo 'Idempotence test: pass' && exit 0)
22+
|| (echo 'Idempotence test: fail' && exit 1)
23+
24+
# TODO - check if mysql is running.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Ansible Role: MySQL
22

3+
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-mysql.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-mysql)
4+
35
Installs MySQL server on RHEL/CentOS or Debian/Ubuntu servers.
46

57
## Requirements

tests/inventory

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
localhost

tests/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- hosts: all
3+
vars_files:
4+
- '../vars/main.yml'
5+
tasks:
6+
- include: '../tasks/main.yml'
7+
handlers:
8+
- include: '../handlers/main.yml'

0 commit comments

Comments
 (0)