.travis.yml 2.53 KB
language: perl
perl:
  - "5.16"
  - "5.18"
  - "5.20"
  - "5.22"

services:
  - mysql
  - postgresql

env:
  - DB=mysql
  - DB=postgresql

# Travis currently offers us 5 parallel builds, so limit to those for faster response time.
matrix:
  exclude:
    - perl: "5.16"
      env: DB=mysql
    - perl: "5.18"
      env: DB=postgresql
    - perl: "5.20"
      env: DB=mysql
    - perl: "5.22"
      env: DB=postgresql

# Use 12.04 platform. Docker based VMs seem slower, and trusty beta has not enough available VMs.
# See https://docs.travis-ci.com/user/ci-environment/
sudo: required

addons:
  apt:
    packages:
    - libxml2-utils
    - gettext

# Install nodejs from external source as it is outdated in 12.04
before_install:
  - curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
  - sudo apt-get install -y nodejs
  - npm -g install eslint

# We have to install the Perl modules via CPAN because the VMs use a perlbrew based Perl, not Ubuntu's system Perl.
install:
  # generate ARCHIVE file
  - perl bin/otrs.CheckSum.pl -a create
  # install OTRSCodePolicy, but skip the SOPM to avoid validation errors.
  - mkdir -p /tmp/OTRSCodePolicy
  - git clone --depth=1 https://github.com/OTRS/otrscodepolicy.git /tmp/OTRSCodePolicy
  - rm /tmp/OTRSCodePolicy/OTRSCodePolicy.sopm
  - cp -rf /tmp/OTRSCodePolicy/* .
  # install OTRS cpan dependencies
  - cpanm --quiet --notest Code::TidyAll Perl::Tidy Perl::Critic Plack Date::Format Net::DNS Net::LDAP IO::Socket::SSL SOAP::Lite Text::CSV_XS JSON::XS XML::LibXML XML::LibXSLT YAML YAML::XS Archive::Zip Crypt::Eksblowfish Encode::HanExtra Mail::IMAPClient Template DBI DateTime
  - cpanm --quiet --notest DBD::mysql || echo "Suppressing exit code $?"
  - cpanm --quiet --notest DBD::Pg    || echo "Suppressing exit code $?"
  # configure OTRS
  - scripts/tools/travis/setup.sh
  # start web server
  - plackup --port 5000 bin/cgi-bin/app.psgi > /tmp/plack.log 2>&1 &

script:
  - perl bin/otrs.CheckModules.pl
  - perl -cw bin/cgi-bin/index.pl
  - perl -cw bin/cgi-bin/app.psgi
  - perl bin/otrs.Console.pl Maint::Database::Check
  - perl bin/otrs.Console.pl Maint::Config::Rebuild
  - perl bin/otrs.Console.pl Dev::UnitTest::Run

notifications:
  email:
    recipients:
      - martin.gruner@otrs.com
    on_success: change
    on_failure: always

  irc:
    channels:
      - "chat.freenode.net#otrs-dev"
    on_success: change
    on_failure: always

  webhooks:
    urls:
      - https://webhooks.gitter.im/e/2a09392eadbc65a19408
    on_success: change
    on_failure: always
    on_start: never