language: php
services: docker

env:
  - VERSION=platform

install:
  - composer create-project silverstripe/installer ~/src
  - docker run -d --name database mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true

before_script:
  - env | sort
  - cd "$VERSION"
  - image="brettt89/silverstripe-web:${VERSION}"
  - image="${image//'/'/-}"

script:
  - travis_retry docker build -t "$image" .
  - docker run --name web --link database "$image" -v ~/src:/var/www/html /var/www/html/framework/sake dev/build

after_script:
  - docker images

language: php
services: docker

env:
  - VERSION=platform

install:
  - composer create-project silverstripe/installer ~/src
  - docker run --name database --env MYSQL_ALLOW_EMPTY_PASSWORD=true mysql
  - echo "<?php \ndefine('SS_DATABASE_SERVER', 'database'); \ndefine('SS_DATABASE_USERNAME', 'root'); \ndefine('SS_DATABASE_PASSWORD', ''); \ndefine('SS_DATABASE_NAME', 'SS_mysite');" > ~/src/_ss_environment.php

before_script:
  - env | sort
  - cd "$VERSION"
  - image="brettt89/silverstripe-web:${VERSION}"
  - image="${image//'/'/-}"

script:
  - travis_retry docker build -t "$image" .
  - docker run --name web --link database --volume ~/src:/var/www/html "$image" php /var/www/html/framework/cli-script.php dev/build

after_script:
  - docker images

Add _ss_environment.php settings for database
NEW: Add _ss_environment.php settings for database
