<commit_before>language: node_js
node_js:
  - "0.10"

branches:
  only:
    - master

env:
  global:
    - secure: <KEY>
    - secure: <KEY>

before_install:
  # Add extra apt repos
  - echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/dsc.sources.list
  - curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
  - echo 'yes' | sudo add-apt-repository ppa:oae/deps
  - echo 'yes' | sudo add-apt-repository ppa:coolwanglu/pdf2htmlex
  - sudo apt-get update

  # Install cassandra 1.2 manually
  - sudo apt-get install -y -o Dpkg::Options::=--force-confnew cassandra=1.2.10
  - sudo sed -i 's/-Xss180k/-Xss256k/g' /etc/cassandra/cassandra-env.sh
  - sudo sh -c "echo 'JVM_OPTS=\"\${JVM_OPTS} -Djava.net.preferIPv4Stack=false\"' >> /etc/cassandra/cassandra-env.sh"
  - sudo service cassandra stop
  - sudo service cassandra start
  - sudo service cassandra status

  # Turn off unneeded services to free some memory
  - sudo service mysql stop
  - sudo service memcached stop
  - sudo service postgresql stop

  # We must ensure phantomjs is not available so the travis build will include it in node_modules when deploying
  - sudo rm -rf /usr/local/phantomjs

  # Install Hilary deps
  - sudo apt-get install -qq graphicsmagick libreoffice pdftk chrpath pdf2htmlex
  - npm install -g grunt-cli
  - git clone --depth 1 --branch master git://github.com/oaeproject/3akai-ux.git ../3akai-ux

  # Install etherpad-lite
  - sudo apt-get install etherpad-lite
  - cd /opt/etherpad
  - sudo touch APIKEY.txt
  - sudo chmod -R 777 .
  - "sed -i 's/defaultPadText\" : \".*\"/defaultPadText\" : \"\"/g' settings.json"
  - echo "<KEY>" > APIKEY.txt
  - node src/node/server.js &> /dev/null &

  # Position ourselves to start the test in "script" phase
  - cd ~/build/oaeproject/Hilary

  # Enable preview processing
  - printf "\n\nconfig.previews.enabled = true;" >> config.js
  - printf "\nconfig.previews.office.binary = '/usr/bin/soffice';" >> config.js
  - printf "\nconfig.previews.pdftk.binary = '/usr/bin/pdftk';" >> config.js
  - printf "\nconfig.previews.pdf2htmlEX.binary = '/usr/bin/pdf2htmlEX';" >> config.js

services:
  - elasticsearch
  - rabbitmq
  - redis-server

script:
  - grunt test-coverage-coveralls

after_success:
  # Package and upload to Amazon S3
  - etc/scripts/travis-upload.sh

after_failure:
  # Compress the logs and upload them to Amazon S3
  - gzip tests.log
  - bin/upload_logs

notifications:
  email:
    - <EMAIL>
  irc: "irc.freenode.org#oae"
<commit_msg>(Issue 858) Configure Etherpad to talk to Cassandra in TravisCI<commit_after>language: node_js
node_js:
  - "0.10"

branches:
  only:
    - master

env:
  global:
    - secure: <KEY>
    - secure: <KEY>

before_install:
  # Add extra apt repos
  - echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/dsc.sources.list
  - curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
  - echo 'yes' | sudo add-apt-repository ppa:oae/deps
  - echo 'yes' | sudo add-apt-repository ppa:coolwanglu/pdf2htmlex
  - sudo apt-get update

  # Install cassandra 1.2 manually
  - sudo apt-get install -y -o Dpkg::Options::=--force-confnew cassandra=1.2.10
  - sudo sed -i 's/-Xss180k/-Xss256k/g' /etc/cassandra/cassandra-env.sh
  - sudo sh -c "echo 'JVM_OPTS=\"\${JVM_OPTS} -Djava.net.preferIPv4Stack=false\"' >> /etc/cassandra/cassandra-env.sh"
  - sudo service cassandra stop
  - sudo service cassandra start
  - sudo service cassandra status

  # Turn off unneeded services to free some memory
  - sudo service mysql stop
  - sudo service memcached stop
  - sudo service postgresql stop

  # We must ensure phantomjs is not available so the travis build will include it in node_modules when deploying
  - sudo rm -rf /usr/local/phantomjs

  # Install Hilary deps
  - sudo apt-get install -qq graphicsmagick libreoffice pdftk chrpath pdf2htmlex
  - npm install -g grunt-cli
  - git clone --depth 1 --branch master git://github.com/oaeproject/3akai-ux.git ../3akai-ux

  # Install etherpad-lite
  - sudo apt-get install etherpad-lite
  - cd /opt/etherpad
  - sudo touch APIKEY.txt
  - sudo chmod -R 777 .

  # Create a keyspace that we can start etherpad up into. There is a chicken-and-egg problem by having unit tests drop/create and have
  # etherpad be available, so we just create a separate keyspace for it
  - "echo \"CREATE KEYSPACE oae WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};\" > /tmp/.create_etherpad_keyspace.cql3"
  - cat /tmp/.create_etherpad_keyspace.cql3
  - cqlsh -3 -f /tmp/.create_etherpad_keyspace.cql3

  # Configure etherpad to talk to Cassandra
  - "sed -i 's/dbType\" : \"dirty/dbType\" : \"cassandra/g' settings.json"
  - "sed -i 's/\"filename\" : \"var\\/dirty.db\"/\"hosts\": [ \"localhost:9160\" ], \"keyspace\": \"oae\", \"cfName\": \"Etherpad\", \"user\": \"\", \"pass\": \"\", \"timeout\": 3000, \"replication\": \"1\", \"strategyClass\": \"SimpleStrategy\", \"cqlVersion\": \"2.0.0\"/g' settings.json"
  - "sed -i 's/defaultPadText\" : \".*\"/defaultPadText\" : \"\"/g' settings.json"
  - cat settings.json

  - echo "<KEY>" > APIKEY.txt
  - node src/node/server.js &> /dev/null &

  # Position ourselves to start the test in "script" phase
  - cd ~/build/oaeproject/Hilary

  # Enable preview processing
  - printf "\n\nconfig.previews.enabled = true;" >> config.js
  - printf "\nconfig.previews.office.binary = '/usr/bin/soffice';" >> config.js
  - printf "\nconfig.previews.pdftk.binary = '/usr/bin/pdftk';" >> config.js
  - printf "\nconfig.previews.pdf2htmlEX.binary = '/usr/bin/pdf2htmlEX';" >> config.js

services:
  - elasticsearch
  - rabbitmq
  - redis-server

script:
  - grunt test-coverage-coveralls

after_success:
  # Package and upload to Amazon S3
  - etc/scripts/travis-upload.sh

after_failure:
  # Compress the logs and upload them to Amazon S3
  - gzip tests.log
  - bin/upload_logs

notifications:
  email:
    - <EMAIL>
  irc: "irc.freenode.org#oae"

{'fraction_non_alphanumeric': 0.13864013266998343, 'fraction_numerical': 0.012603648424543947, 'mean_word_length': 3.01798800799467, 'pattern_counts': {'":': 9, '<': 11, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2696275', 'n_tokens_mistral': 2287, 'n_tokens_neox': 2128, 'n_words': 568}