language: generic

services:
  - docker

env:
  matrix:
    - VERSION=5.6
    - VERSION=7.0
    - VERSION=7.1
    - VERSION=7.2

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install libfcgi0ldbl  # cgi-fcgi binary used in tests

install:
  - curl -fsSL https://get.docksal.io | sh
  - fin version
  - fin sysinfo

script:
  - cd ${VERSION}
  - travis_retry make && make test  # Retry builds, as pecl.php.net tends to time out often

after_failure:
  - make logs

language: generic

services:
  - docker

env:
  global:
    - REPO=docksal/cli
    - LATEST_VERSION=7.2
  matrix:
    - VERSION=5.6
    - VERSION=7.0
    - VERSION=7.1
    - VERSION=7.2

before_install:
  - sudo apt-get -qq update
  - sudo apt-get install libfcgi0ldbl  # cgi-fcgi binary used in tests

install:
  - curl -fsSL https://get.docksal.io | sh
  - fin version
  - fin sysinfo

script:
  - cd ${VERSION}
  - travis_retry make && make test  # Retry builds, as pecl.php.net tends to time out often

after_success: |
  if [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then
    [[ "${TRAVIS_BRANCH}" == "develop" ]] && TAG="edge-php${VERSION}"
    [[ "${TRAVIS_BRANCH}" == "master" ]] && TAG="php${VERSION}"
    [[ "${TRAVIS_TAG}" != "" ]] && TAG="${TRAVIS_TAG:1:3}-php${VERSION}"

    if [[ "$TAG" != "" ]]; then
      docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}"
      # Push edge, stable and release tags
      docker push ${REPO}:${TAG}

      # Push "latest" tag
      [[ "${TRAVIS_BRANCH}" == "master" ]] && [[ "${VERSION}" == "${LATEST_VERSION}" ]] && docker push ${REPO}:latest
    fi
  fi

after_failure:
  - make logs

Use TravisCI to push images to Docker Hub
Use TravisCI to push images to Docker Hub
