language: bash
services: docker

env:
  - VERSION=2.4 VARIANT=
  - VERSION=2.4 VARIANT=slim
  - VERSION=2.4 VARIANT=alpine
  - VERSION=2.3 VARIANT=
  - VERSION=2.3 VARIANT=slim
  - VERSION=2.3 VARIANT=alpine
  - VERSION=2.2 VARIANT=
  - VERSION=2.2 VARIANT=slim
  - VERSION=2.2 VARIANT=alpine
  - VERSION=2.1 VARIANT=
  - VERSION=2.1 VARIANT=slim
  - VERSION=2.1 VARIANT=alpine

install:
  - git clone https://github.com/docker-library/official-images.git ~/official-images

before_script:
  - env | sort
  - cd "$VERSION"
  - image="$(awk '$1 == "FROM" { print $2; exit }' onbuild/Dockerfile)${VARIANT:+-$VARIANT}"

script:
  - docker build -t "$image" "${VARIANT:-.}"
  - ~/official-images/test/run.sh "$image"
# the "onbuild" variant has to happen with the base variant because it's FROM it
  - true && [ "$VARIANT" ] || docker build -t "${image}-onbuild" onbuild

after_script:
  - docker images

# vim:set et ts=2 sw=2:

language: bash
services: docker

env:
  - VERSION=2.4 VARIANT=
  - VERSION=2.4 VARIANT=slim
  - VERSION=2.4 VARIANT=alpine
  - VERSION=2.3 VARIANT=
  - VERSION=2.3 VARIANT=slim
  - VERSION=2.3 VARIANT=alpine
  - VERSION=2.2 VARIANT=
  - VERSION=2.2 VARIANT=slim
  - VERSION=2.2 VARIANT=alpine
  - VERSION=2.1 VARIANT=
  - VERSION=2.1 VARIANT=slim
  - VERSION=2.1 VARIANT=alpine

install:
  - git clone --depth 1 https://github.com/docker-library/official-images.git ~/official-images

before_script:
  - env | sort
  - cd "$VERSION"
  - image="$(awk '$1 == "FROM" { print $2; exit }' onbuild/Dockerfile)${VARIANT:+-$VARIANT}"

script:
  - docker build -t "$image" "${VARIANT:-.}"
  - ~/official-images/test/run.sh "$image"
# the "onbuild" variant has to happen with the base variant because it's FROM it
  - true && [ "$VARIANT" ] || docker build -t "${image}-onbuild" onbuild

after_script:
  - docker images

# vim:set et ts=2 sw=2:

Set clone depth=1 in Travis CI to speed it up
Set clone depth=1 in Travis CI to speed it up
