language: node_js
node_js:
  - "11"
cache:
  npm: true
  directories:
    - ~/.cache
addons:
  postgresql: "9.6"
before_script:
  - cp .env.travis api/.env && cp .env.travis map/.env
  - cd api && yarn test:init && cd ..
before_install:
  - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.9.2
  - export PATH="$HOME/.yarn/bin:$PATH"
jobs:
  include:
    - stage: test
      name: "API"
      script: cd api && yarn test
    - name: "Schemas"
      script: cd schemas && yarn test
    - name: "Map"
      script: cd map && yarn test
    - name: "Admin"
      script: cd admin && yarn test
    - stage: integration
      name: "Integration Tests"
      script: yarn cypress:ci
    - stage: deployment
      name: "Staging Deployment"
      script:
        - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
        - echo build is on branch $BRANCH
        - if [ "$BRANCH" != "master" ] ; then echo "branch is not master, not deploying" ; exit 0 ;  fi
        - echo 'deployment'
notifications:
  slack: ernteteilen:0QwBhQegAchwMOPjhLdqwtNm

language: node_js
node_js:
  - "11"
cache:
  npm: true
  directories:
    - ~/.cache
addons:
  postgresql: "9.6"
before_script:
  - cp .env.travis api/.env && cp .env.travis map/.env
  - cd api && yarn test:init && cd ..
before_install:
  - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.9.2
  - export PATH="$HOME/.yarn/bin:$PATH"
jobs:
  include:
    - stage: test
      name: "API"
      script: cd api && yarn test
    - name: "Schemas"
      script: cd schemas && yarn test
    - name: "Map"
      script: cd map && yarn test
    - name: "Admin"
      script: cd admin && yarn test
    #    - stage: integration
    #      name: "Integration Tests"
    #      script: yarn cypress:ci
    - stage: deployment
      name: "Staging Deployment"
      script:
        - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
        - echo build is on branch $BRANCH
        - if [ "$BRANCH" != "master" ] ; then echo "branch is not master, not deploying" ; exit 0 ;  fi
        - echo 'deployment'
notifications:
  slack: ernteteilen:0QwBhQegAchwMOPjhLdqwtNm

Disable integration tests until implemented
Testing: Disable integration tests until implemented
