mysociety/alaveteli

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
dist: trusty
sudo: required
language: ruby
branches:
  only:
    - master
    - develop
rvm:
  - 2.0.0 # Ubuntu Trusty
  - 2.1.5 # Debian Jessie
  - 2.3.3 # Debian Stretch
  - 2.3 # Latest official 2.3.x
  - 2.4 # Latest official 2.4.x
  - 2.5 # Latest official 2.5.x
  - ruby-head
gemfile:
  - Gemfile
  - Gemfile.rails5
matrix:
  fast_finish: true
  exclude:
    # Ignore Rubies which Rails 5 doesn't support
    - rvm: 2.0.0
      gemfile: Gemfile.rails5
    - rvm: 2.1.5
      gemfile: Gemfile.rails5
  allow_failures:
    - rvm: 2.4 # Latest official 2.4.x
    - rvm: 2.5 # Latest official 2.5.x
    - rvm: ruby-head
    - gemfile: Gemfile.rails5
env:
  global:
    - S3_REGION=us-east-1
    - S3_BUCKET_NAME=alaveteli-bundle-cache
    - secure: "cbZMhxbih4k2syqykwVprnBBTyD9Rk9pVhwM2W1Oa3Y9QIn79giL2yTUrJi3+bapHHFedWstG1wkLxEalc/Ei1G4vWYDqXiOtdzYR/WMqqCyd8royrkusist+rVcolvZ2dTCu8uvmteQ6sE3/FsoayTlYJmWCNFWhAiWayaai8Q="
before_install:
  - sudo add-apt-repository --remove 'http://us-central1.gce.archive.ubuntu.com/ubuntu/ main restricted'
  - sudo add-apt-repository --remove 'http://us-central1.gce.archive.ubuntu.com/ubuntu/ universe'
  - sudo add-apt-repository --remove 'http://us-central1.gce.archive.ubuntu.com/ubuntu/ multiverse'
  - sudo add-apt-repository http://archive.ubuntu.com/ubuntu/
  - sudo add-apt-repository 'http://archive.ubuntu.com/ubuntu/ universe'
  - sudo add-apt-repository 'http://archive.ubuntu.com/ubuntu/ multiverse'
  - sudo apt-get -qq update
  - sudo locale-gen --no-archive en_GB
  - sudo locale-gen --no-archive en_GB.UTF-8
  - sudo update-locale
  - git submodule update --init --recursive
  - psql -c "create database template_utf8 template template0 encoding 'UTF-8';" -U postgres
  - psql -c "update pg_database set datistemplate=true where datname='template_utf8';" -U postgres
  - psql -c "create database foi_test template template_utf8;" -U postgres
  - cp config/database.yml-test config/database.yml
  - cp config/general.yml-example config/general.yml
  - cp config/newrelic.yml-example config/newrelic.yml
  - sudo apt-get update
  - export DEBIAN_FRONTEND=noninteractive
  - sudo apt-get -y install exim4-daemon-light
  - sudo apt-get -y install `cut -d " " -f 1 config/packages | egrep -v "(^#|wkhtml|bundler|^ruby$|^ruby1.9.1$|^rubygems$|^rake)"`
  - RAILS_ENV=test ./script/rails-post-deploy
  - psql -c 'CREATE COLLATION "en_GB" (LOCALE = "en_GB.utf8");' -U postgres foi_test
  - psql -c 'CREATE COLLATION "en_GB.utf8" (LOCALE = "en_GB.utf8");' -U postgres foi_test
  - psql -c 'CREATE COLLATION "en" (LOCALE = "en_GB.utf8");' -U postgres foi_test
  - RAILS_ENV=test ./script/update-xapian-index
install: echo 'Bundle installed through script/rails-post-deploy'
notifications:
  email:
    recipients:
      - cron-whatdotheyknow@mysociety.org
addons:
  code_climate:
    repo_token: ee19b27266ded8ab2d2c4e65c66a79fc58b11ff9c4bd84673ae21b1a565f3e6d