# We're going to build and run a container in order to test the project. Because
# this process will take place in a container itself, we need to use the 'Docker
# in Docker' image, aka 'dind'.
image: gitlab/dind

stages:
  - test

# Build the image, run the container. Exposing the web service on port 3000 is
# an arbitrary choice.
before_script:
  - docker info
  - build_dir=`pwd`
  - docker run -dP -p 3000:80 --name=recipe -v $build_dir:/var/www sminnee/silverstripe-lamp
  - docker exec recipe composer install
  - docker exec recipe /bin/bash framework/sake /dev/build

# Run the unit tests by invoking the Makefile within the running container.
test:
  stage: test
  script:
    - docker exec recipe make test

Support for Gitlab CI testing.
NEW: Support for Gitlab CI testing.
