language: generic

sudo: required

# Only run test when committing to a master branch.
branches:
  only:
    - master

env:
  globaL:
    - COMPOSE_HTTP_TIMEOUT=3600
    - AEGIR_TESTS_VERSION=refactor-entrypoint

#env:
#  - test: Ubuntu 14.04 Apache
#    distribution: ubuntu
#    version: 14.04
#    init: /sbin/init
#    run_opts: ""

addons:
  hosts:
    - aegir.local.computer
    - sitetest.aegir.local.computer

services:
  - docker

before_install:
  # upgrade docker-engine to specific version
  - git clone http://github.com/aegir-project/tests.git
  - cd tests
  - git checkout $AEGIR_TESTS_VERSION
  - sudo bash travis/prepare-docker.sh

  - sudo mkdir vendor
  - sudo chmod 777 vendor

  - sudo mkdir bin
  - sudo chmod 777 bin

  - cd ..
  - sudo docker build --rm -t aegir/hostmaster:test .
  - cd tests/travis
script:

  # Launch docker-compose.yml file within tests repo.
  - sudo docker-compose --file docker-compose-tests.yml run hostmaster

language: generic

sudo: required

# Only run test when committing to a master branch.
branches:
  only:
    - master

env:
  globaL:
    - COMPOSE_HTTP_TIMEOUT=3600
    - AEGIR_TESTS_VERSION=refactor-entrypoint

#env:
#  - test: Ubuntu 14.04 Apache
#    distribution: ubuntu
#    version: 14.04
#    init: /sbin/init
#    run_opts: ""

addons:
  hosts:
    - aegir.local.computer
    - sitetest.aegir.local.computer

services:
  - docker

before_install:
  # upgrade docker-engine to specific version
  - git clone http://github.com/aegir-project/tests.git
  - cd tests
  - git checkout $AEGIR_TESTS_VERSION
  - sudo bash travis/prepare-docker.sh

  - sudo mkdir vendor
  - sudo chmod 777 vendor

  - sudo mkdir bin
  - sudo chmod 777 bin

  - cd ..

  # First build stock image.
  - sudo docker build --rm -t aegir/hostmaster .
  - sudo docker build --rm -t aegir/hostmaster:test -f Dockerfile-test .
  - cd tests/travis
script:

  # Launch docker-compose.yml file within tests repo.
  - sudo docker-compose --file docker-compose-tests.yml run hostmaster

Test both dockerfiles by building the main then building the test.
Test both dockerfiles by building the main then building the test.
