machine:
  services:
    - docker

dependencies:
  pre:
    - sudo curl -fsSL https://raw.githubusercontent.com/michaelcontento/circleci-matrix/master/src/circleci-matrix.sh -o /usr/local/bin/circleci-matrix
    - sudo chmod +x /usr/local/bin/circleci-matrix

  override:
    - docker info
    - git clone https://github.com/sstephenson/bats.git /tmp/bats
    - sudo /tmp/bats/install.sh /usr/local

  post:
    - |+
        cat > .circleci-matrix.yml <<EOF
        env:
          - OPENCAST_DISTRIBUTION=allinone
          - OPENCAST_DISTRIBUTION=admin
          - OPENCAST_DISTRIBUTION=presentation
          - OPENCAST_DISTRIBUTION=worker

        command:
          - make "build-${OPENCAST_DISTRIBUTION}"
        EOF
    - circleci-matrix:
        # 4 * 15min if not parallel
        timeout: 3600

test:
  override:
    - |+
      cat > .circleci-matrix.yml <<EOF
      env:
        - OPENCAST_DISTRIBUTION=allinone
        - OPENCAST_DISTRIBUTION=admin
        - OPENCAST_DISTRIBUTION=presentation
        - OPENCAST_DISTRIBUTION=worker

      command:
        - make test-common "test-${OPENCAST_DISTRIBUTION}"
      EOF
    - circleci-matrix

machine:
  services:
    - docker

dependencies:
  pre:
    - sudo curl -fsSL https://raw.githubusercontent.com/michaelcontento/circleci-matrix/master/src/circleci-matrix.sh -o /usr/local/bin/circleci-matrix
    - sudo chmod +x /usr/local/bin/circleci-matrix

  override:
    - docker info
    - git clone https://github.com/sstephenson/bats.git /tmp/bats
    - sudo /tmp/bats/install.sh /usr/local

  post:
    - |+
        cat > .circleci-matrix.yml <<EOF
        env:
          - OPENCAST_DISTRIBUTION=allinone
          - OPENCAST_DISTRIBUTION=admin
          - OPENCAST_DISTRIBUTION=presentation
          - OPENCAST_DISTRIBUTION=worker

        command:
          - make "build-\${OPENCAST_DISTRIBUTION}"
        EOF
    - circleci-matrix:
        # 4 * 15min if not parallel
        timeout: 3600

test:
  override:
    - |+
      cat > .circleci-matrix.yml <<EOF
      env:
        - OPENCAST_DISTRIBUTION=allinone
        - OPENCAST_DISTRIBUTION=admin
        - OPENCAST_DISTRIBUTION=presentation
        - OPENCAST_DISTRIBUTION=worker

      command:
        - make test-common "test-\${OPENCAST_DISTRIBUTION}"
      EOF
    - circleci-matrix

Fix error in Circle CI script
Fix error in Circle CI script
