ansible-role-mongodb/.travis.yml

125 lines
3.7 KiB
YAML

# .travis.yml
---
dist: trusty
sudo: required
language: python
python:
- "3.6"
env:
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=14.04
MONGODB_VERSION=3.4
- >
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
- >
DISTRIBUTION=centos
DIST_VERSION=6-builded
MONGODB_VERSION=2.6
- >
DISTRIBUTION=centos
DIST_VERSION=6-builded
MONGODB_VERSION=3.0
- >
DISTRIBUTION=centos
DIST_VERSION=6-builded
MONGODB_VERSION=3.2
- >
DISTRIBUTION=centos
DIST_VERSION=6-builded
MONGODB_VERSION=3.4
- >
DISTRIBUTION=centos
DIST_VERSION=7-builded
MONGODB_VERSION=2.6
- >
DISTRIBUTION=centos
DIST_VERSION=7-builded
MONGODB_VERSION=3.0
- >
DISTRIBUTION=centos
DIST_VERSION=7-builded
MONGODB_VERSION=3.2
- >
DISTRIBUTION=centos
DIST_VERSION=7-builded
MONGODB_VERSION=3.4
# - >
# distribution=debian
# version=7
services:
- docker
install:
- bash tests/scripts/before_install.sh
script:
# Test 1
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION}
# Idempotence test
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION}
| 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 2
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
# Idempotence test
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-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
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
# Idempotence test
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-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
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
# Idempotence test
- >
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-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)