Skip to content

Commit

Permalink
Travis CI: Parallelize the test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
gildegoma committed Jul 26, 2020
1 parent 00c1252 commit d2fab66
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ language: generic
sudo: required

env:
DOCKER_COMPOSE_VERSION: 1.26.2
global:
- DOCKER_COMPOSE_VERSION=1.26.2
- ANSIBLE_VERSION=2.9.9
jobs:
- PLATFORM=centos PLAYBOOK=user.yml
- PLATFORM=debian PLAYBOOK=user.yml
- PLATFORM=ubuntu PLAYBOOK=user.yml
- PLATFORM=centos PLAYBOOK=root.yml
- PLATFORM=debian PLAYBOOK=root.yml
- PLATFORM=ubuntu PLAYBOOK=root.yml

services:
- docker
Expand All @@ -22,24 +31,18 @@ before_install:
- sudo mv docker-compose /usr/local/bin

install:
- sudo pip install ansible==2.9.9 > /dev/null 2>&1
- sudo pip install ansible==$ANSIBLE_VERSION > /dev/null 2>&1

script:
- cd tests
- docker-compose up -d
- ansible-playbook user.yml -l centos
- ansible-playbook user.yml -l debian
- ansible-playbook user.yml -l ubuntu
- docker-compose config --services | grep $PLATFORM | xargs docker-compose up -d
- ansible-playbook $PLAYBOOK -l $PLATFORM
- docker-compose down
- docker-compose up -d
- ansible-playbook root.yml -l centos
- ansible-playbook root.yml -l debian
- ansible-playbook root.yml -l ubuntu

before_cache:
- >
mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1-$PLATFORM.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1-$PLATFORM.tar.gz'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

0 comments on commit d2fab66

Please sign in to comment.