<commit_before>sudo: required
language: ruby
cache:
  bundler: true
  directories:
    - travis_phantomjs
    - tmp/cache/assets/test/sprockets
env:
  matrix:
    - GROWSTUFF_ELASTICSEARCH='true' RSPEC_TAG=elasticsearch STATIC_CHECKS=false
    - GROWSTUFF_ELASTICSEARCH='false' RSPEC_TAG=~elasticsearch STATIC_CHECKS=false
    - STATIC_CHECKS=true
  global:
    - GROWSTUFF_SITE_NAME="Growstuff (travis)"
    - RAILS_SECRET_TOKEN='<KEY>'
    - secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
before_install:
  - ./script/install_phantomjs;
  - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
  # Force Travis to use Elastic Search 2.4.0
  - >
    if [ "${GROWSTUFF_ELASTICSEARCH}" = "true" ]; then
      sudo dpkg -r elasticsearch;
      curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.0/elasticsearch-2.4.0.deb;
      sudo dpkg -i --force-confnew elasticsearch-2.4.0.deb;
      sudo service elasticsearch start;
      sleep 10;
      curl localhost:9200;
    fi
before_script:
  - set -e
  - >
    if [ "${STATIC_CHECKS}" = "true" ]; then
      ./script/install_linters;
    else
      RAILS_ENV=test bundle exec rake db:create db:migrate;
      bundle exec rake assets:precompile;
    fi
  - set +e
script:
  - set -e
  - >
    if [ "${STATIC_CHECKS}" = "true" ]; then
      ./script/check_static.rb
    else
      bundle exec rake db:migrate --trace;
      bundle exec rspec --tag $RSPEC_TAG spec/;
      bundle exec rake jasmine:ci;
    fi;
  - set +e
before_deploy:
  - bundle exec script/heroku_maintenance.rb on
deploy:
  provider: heroku
  api_key:
    secure: "<KEY>
  on:
    repo: Growstuff/growstuff
  app:
    dev: growstuff-staging
    master: growstuff-prod
    travis_deploy: tranquil-basin-3130
    travis_containers: tranquil-basin-3130
  run:
    - "rake db:migrate"
    - "script/deploy-tasks.sh"
    - restart
after_deploy:
  - bundle exec script/heroku_maintenance.rb off
addons:
  code_climate:
    repo_token: 462e015bbdaabfb20910fc07f2fea253410ecb131444e00f97dbf32dc6789ca6<commit_msg>Only deploy from the Elasticsearch build job<commit_after>sudo: required
language: ruby
cache:
  bundler: true
  directories:
    - travis_phantomjs
    - tmp/cache/assets/test/sprockets
env:
  matrix:
    - GROWSTUFF_ELASTICSEARCH='true' RSPEC_TAG=elasticsearch STATIC_CHECKS=false
    - GROWSTUFF_ELASTICSEARCH='false' RSPEC_TAG=~elasticsearch STATIC_CHECKS=false
    - STATIC_CHECKS=true
  global:
    - GROWSTUFF_SITE_NAME="Growstuff (travis)"
    - RAILS_SECRET_TOKEN='<KEY>'
    - secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
before_install:
  - ./script/install_phantomjs;
  - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
  # Force Travis to use Elastic Search 2.4.0
  - >
    if [ "${GROWSTUFF_ELASTICSEARCH}" = "true" ]; then
      sudo dpkg -r elasticsearch;
      curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.0/elasticsearch-2.4.0.deb;
      sudo dpkg -i --force-confnew elasticsearch-2.4.0.deb;
      sudo service elasticsearch start;
      sleep 10;
      curl localhost:9200;
    fi
before_script:
  - set -e
  - >
    if [ "${STATIC_CHECKS}" = "true" ]; then
      ./script/install_linters;
    else
      RAILS_ENV=test bundle exec rake db:create db:migrate;
      bundle exec rake assets:precompile;
    fi
  - set +e
script:
  - set -e
  - >
    if [ "${STATIC_CHECKS}" = "true" ]; then
      ./script/check_static.rb
    else
      bundle exec rake db:migrate --trace;
      bundle exec rspec --tag $RSPEC_TAG spec/;
      bundle exec rake jasmine:ci;
    fi;
  - set +e
before_deploy:
  - bundle exec script/heroku_maintenance.rb on
deploy:
  provider: heroku
  api_key:
    secure: "<KEY>
  on:
    repo: Growstuff/growstuff
    condition: "$RSPEC_TAG = elasticsearch"
  app:
    dev: growstuff-staging
    master: growstuff-prod
    travis_deploy: tranquil-basin-3130
    travis_containers: tranquil-basin-3130
  run:
    - "rake db:migrate"
    - "script/deploy-tasks.sh"
    - restart
after_deploy:
  - bundle exec script/heroku_maintenance.rb off
addons:
  code_climate:
    repo_token: <KEY>
{'fraction_non_alphanumeric': 0.10508701472556894, 'fraction_numerical': 0.03815261044176707, 'mean_word_length': 3.3566569484936832, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1111169', 'n_tokens_mistral': 1906, 'n_tokens_neox': 1784, 'n_words': 302}