ansible-role-mongodb/.travis.yml

108 lines
3.2 KiB
YAML
Raw Normal View History

2016-04-17 13:43:00 +00:00
# .travis.yml
---
sudo: required
env:
- >
2016-04-17 14:56:00 +00:00
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=14.04
MONGODB_VERSION=3.2
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=14.04
MONGODB_VERSION=3.0
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=14.04
MONGODB_VERSION=2.6
2016-04-18 04:48:13 +00:00
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=12.04
MONGODB_VERSION=3.2
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=12.04
MONGODB_VERSION=3.0
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=12.04
MONGODB_VERSION=2.6
2016-04-17 13:47:22 +00:00
# - >
# distribution=ubuntu-upstart
# version=12.04
# - >
# distribution=debian
# version=7
2016-04-17 13:43:00 +00:00
services:
- docker
before_install:
- sudo apt-get update
# Latest Ansible install
- sudo apt-add-repository -y ppa:ansible/ansible
2016-04-17 13:47:22 +00:00
- sudo apt-get update
2016-04-17 13:43:00 +00:00
- sudo apt-get install ansible python-pip -y
2016-04-17 13:47:22 +00:00
- sudo pip install docker-py==1.5.0
2016-04-17 13:43:00 +00:00
# Pull docker image
2016-04-17 14:56:00 +00:00
- sudo docker pull ${DISTRIBUTION}:${DIST_VERSION}
2016-04-17 13:47:22 +00:00
- sudo ln -s ${PWD} /etc/ansible/roles/greendayonfire.mongodb
2016-04-17 13:43:00 +00:00
script:
2016-04-17 15:44:11 +00:00
# Test 1
2016-04-17 14:56:00 +00:00
- sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION}
2016-04-17 13:43:00 +00:00
# Idempotence test
- >
2016-04-17 14:56:00 +00:00
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION}
2016-04-17 13:43:00 +00:00
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Delete all containers
2016-04-17 13:47:22 +00:00
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
2016-04-17 15:44:11 +00:00
# Test 2
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Delete all containers
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
# Test 3
- >
2016-04-17 17:18:31 +00:00
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
2016-04-17 15:44:11 +00:00
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Delete all containers
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
# Test 4
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)