|
2 | 2 |
|
3 | 3 | language: python
|
4 | 4 | python: "2.7"
|
| 5 | +sudo: required |
| 6 | +dist: trusty |
5 | 7 | services:
|
6 | 8 | - docker
|
7 | 9 |
|
8 | 10 | env:
|
9 |
| - global: |
10 |
| - - ROLE_GLOBALS="postgresql_shared_buffers=32MB" |
11 | 11 | matrix:
|
12 |
| - - ROLE_OPTIONS="postgresql_version=9.1" ANSIBLE_VERSION="1.9.4" |
13 |
| - - ROLE_OPTIONS="postgresql_version=9.2" ANSIBLE_VERSION="1.9.4" |
14 |
| - - ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="1.9.4" |
15 |
| - - ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="1.9.4" |
16 |
| - - ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="1.9.4" |
17 |
| - - ROLE_OPTIONS="postgresql_version=9.6" ANSIBLE_VERSION="1.9.4" |
18 |
| - - ROLE_OPTIONS="postgresql_version=9.1" ANSIBLE_VERSION="2.1.2.0" |
19 |
| - - ROLE_OPTIONS="postgresql_version=9.2" ANSIBLE_VERSION="2.1.2.0" |
20 |
| - - ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="2.1.2.0" |
21 |
| - - ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="2.1.2.0" |
22 |
| - - ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="2.1.2.0" |
23 |
| - - ROLE_OPTIONS="postgresql_version=9.6" ANSIBLE_VERSION="2.1.2.0" |
24 |
| - |
25 |
| -before_install: |
26 |
| - # Remove the PostgreSQL installed by Travis |
27 |
| - - sudo apt-get purge pgdg-keyring '^postgresql.*' -y |
28 |
| - - sudo apt-get autoremove -y -qq |
29 |
| - - sudo rm -rf /etc/postgresql |
30 |
| - - sudo rm -rf /var/lib/postgresql |
31 |
| - - sudo rm -f /etc/apt/sources.list.d/pgdg-source.list |
32 |
| - # Install some dependencies |
33 |
| - - sudo apt-get update -qq -y |
34 |
| - - sudo apt-get install -qq -y python-apt python-pycurl locales |
35 |
| - - echo 'en_US.UTF-8 UTF-8' | sudo tee /var/lib/locales/supported.d/local |
| 12 | + - IMAGE_NAME="ubuntu-upstart:14.04" |
| 13 | + - IMAGE_NAME="ubuntu:16.04-builded" |
| 14 | + - IMAGE_NAME="debian:8-builded" |
| 15 | + - IMAGE_NAME="debian:9-builded" |
| 16 | + - IMAGE_NAME="centos:7-builded" |
| 17 | + - IMAGE_NAME="centos:6-builded" |
36 | 18 |
|
37 | 19 | install:
|
38 |
| - - pip install ansible=="$ANSIBLE_VERSION" |
| 20 | + - pip install ansible=="2.4.2.0" docker-py |
| 21 | + - ln -s ${PWD} tests/docker/ANXS.postgresql |
39 | 22 |
|
40 | 23 | script:
|
41 |
| - - echo localhost > inventory |
42 |
| - |
43 | 24 | # Syntax check
|
44 |
| - - ansible-playbook -i inventory tests/playbook.yml --syntax-check |
| 25 | + - ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml --syntax-check |
45 | 26 |
|
46 | 27 | # Play test
|
47 |
| - - ansible-playbook -i inventory tests/playbook.yml --connection=local --sudo -e "$ROLE_GLOBALS $ROLE_OPTIONS" |
| 28 | + - ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml |
48 | 29 |
|
49 | 30 | # Idempotence test
|
50 |
| - - ansible-playbook -i inventory tests/playbook.yml --connection=local --sudo -e "$ROLE_GLOBALS $ROLE_OPTIONS" > idempotence_out |
| 31 | + - ansible-playbook -i tests/docker/hosts -e image_name=${IMAGE_NAME} tests/docker/site.yml > idempotence_out |
51 | 32 | - ./tests/idempotence_check.sh idempotence_out
|
52 | 33 |
|
53 |
| - # Testing with docker (experimental) |
54 |
| - - docker build -f tests/Dockerfile-ubuntu14.04 -t postgres_ubuntu14.04 . |
55 |
| - - docker build -f tests/Dockerfile-centos6 -t postgres_centos6 . |
| 34 | +notifications: |
| 35 | + webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
0 commit comments