# travisci config
env:
  global:
  - MIAB_LDAP_PROJECT=true

language: shell
os: linux
dist: bionic

jobs:
  fast_finish: true
  include:
  # JOB: MiaB-LDAP connected to a remote Nextcloud
  - env:
      - PRIMARY_HOSTNAME=box1.abc.com
      - FEATURE_MUNIN=false
    name: remote-nextcloud-docker
    before_install:
      - echo "==== ENVIRONMENT ===="
      - env | sort
      - echo "UMASK=$(umask)"
      - echo "==== AppArmor Status ===="
      - (sudo aa-status; true)
      - echo "==== NETWORK INFO ===="
      - hostname -I
      - hostname -i
      - hostname
      - hostname --fqdn
      - ip add
      - sysctl -a 2>/dev/null | grep -i ipv6 | grep disable
    install:
      # setup with 'basic' data before setting up again using
      # a remote nextcloud to verify ownCloud contacts are still
      # available
      - sudo tests/system-setup/remote-nextcloud-docker.sh upgrade basic
    script:
      # launch automated tests, but skip tests that require remote
      # smtp support because Travis-CI blocks outgoing port 25
      - sudo tests/runner.sh -dumpoutput -no-smtp-remote default remote-nextcloud upgrade-basic

  # JOB: Upgrade from upstream install
  - env:
      - PRIMARY_HOSTNAME=box2.abc.com
      #- UPSTREAM_TAG=master
      - MIAB_UPSTREAM_GIT=https://github.com/fspoettel/mailinabox.git
      - UPSTREAM_TAG=admin-panel-2fa
    name: upgrade-from-upstream
    install:
      - sudo tests/system-setup/upgrade-from-upstream.sh basic totpuser
    script:
      # launch automated tests, but skip tests that require remote
      # smtp support because Travis-CI blocks outgoing port 25
      - sudo tests/runner.sh -dumpoutput -no-smtp-remote upgrade-basic upgrade-totpuser default