<commit_before>language: scala
dist: trusty
sudo: false
scala:
  - 2.12.11
jdk:
  - openjdk8

services:
  - docker
  - memcached
addons:
  postgresql: "9.5"

cache:
  directories:
  - $HOME/.ivy2/cache
  - $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION

notifications:
  slack:
    template:
      - "Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) of %{repository}@%{branch} by %{author} %{result} in %{duration}"
      - "Build %{commit}: %{commit_message}"
    rooms:
      secure: <KEY>

branches:
  only:
    - fix-staging-build
    - master
    - testing
    - dev

# Handle git submodules yourself
git:
    submodules: false

env:
  global:
    - RUMPEL_BUCKET=dswift-hat-sandbox-frontend-build-artifacts
    - AWS_DEFAULT_REGION=eu-west-1
    - secure: "<KEY>
    - secure: "<KEY>
    - secure: <KEY>
    - secure: <KEY>

matrix:
  include:
    - env:
      - REPOSITORY_NAME=dataswift-platform-stage
      - RUMPEL=sandbox
      - ALT_RUMPEL=sandbox-react
      - secure: "<KEY>
      - secure: "<KEY>
    - env:
      - REPOSITORY_NAME=hubat
      - RUMPEL=sandbox
      - ALT_RUMPEL=sandbox-react
    - env:
      - REPOSITORY_NAME=hubofallthings
      - RUMPEL=live
      - ALT_RUMPEL=live-react
      - secure: "<KEY>
      - secure: "<KEY> 


# Use sed to replace the SSH URL with the public URL, then initialize submodules
before_install:
  - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
  - git submodule update --init --recursive

install:
  - pip install --user awscli
  - export PATH=$PATH:$HOME/.local/bin

# Set up test database and user
# Copy the frontend assets from S3 to the right location
before_script:
  - psql -c "CREATE DATABASE testhatdb1;" -U postgres
  - psql -c "CREATE USER testhatdb1 WITH PASSWORD '<PASSWORD>';" -U postgres
  - psql -c "GRANT CREATE ON DATABASE testhatdb1 TO testhatdb1" -U postgres
  - |
    if [[ "$TRAVIS_PULL_REQUEST" = "false" || -z "$RUMPEL" ]]; then
      cd ./hat/app/org/hatdex/hat/phata/assets/
      aws s3 cp s3://${RUMPEL_BUCKET}/${RUMPEL} rumpel --recursive
      aws s3 cp s3://${RUMPEL_BUCKET}/${ALT_RUMPEL} alt-rumpel --recursive
      cp rumpel/*.js* js/
      cp rumpel/*.css stylesheets/
      gzip --keep --force js/*.bundle.js
      cp -r rumpel/assets/* .
      cp -r alt-rumpel/* .
      rm -r rumpel
      rm -r alt-rumpel
      cd -
    fi
<commit_msg>DSE-661 #comment curl install awscli rather than pip.<commit_after>language: scala
dist: trusty
sudo: false
scala:
  - 2.12.11
jdk:
  - openjdk8

services:
  - docker
  - memcached
addons:
  postgresql: "9.5"

cache:
  directories:
  - $HOME/.ivy2/cache
  - $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION

notifications:
  slack:
    template:
      - "Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) of %{repository}@%{branch} by %{author} %{result} in %{duration}"
      - "Build %{commit}: %{commit_message}"
    rooms:
      secure: <KEY>

branches:
  only:
    - fix-staging-build
    - master
    - testing
    - dev

# Handle git submodules yourself
git:
    submodules: false

env:
  global:
    - RUMPEL_BUCKET=dswift-hat-sandbox-frontend-build-artifacts
    - AWS_DEFAULT_REGION=eu-west-1
    - secure: "<KEY>
    - secure: "<KEY>
    - secure: <KEY>
    - secure: <KEY>

matrix:
  include:
    - env:
      - REPOSITORY_NAME=dataswift-platform-stage
      - RUMPEL=sandbox
      - ALT_RUMPEL=sandbox-react
      - secure: "<KEY>
      - secure: "mt+3rmL9MkQDQlIQoKUhD+0/lq4SBK3ZlKnNCJzRXSKrficeZdWfhzCRN3iOvuPpzuYkUelJV8M9DwntkKjP5oiT160mCBTCu27kj4AYryiwd96PIBDcM3lIjd/JO4DMGHeCRLZM9ALISfvzTHwuQuX0bAufkW0typhgby2LfKJHBBcc4b2sNzCVoJFn1YlF5bf35ZziF2KXBfz+GDU539AY4hVzKE5pCmIUMGsc5gholvhQkRWRYQcllexlHzwThBf2C+az5YIgLspLSD81y6FA5THI7ar7R4ahBhtJuNkTl0x+Wtjz7XVnXGD71rKgrvp9kBcQNLHWrucQJwsllekrUkShoFd3NJ/aGpUkDBaLs0rR72Yk9G2tP4TOg1zQBH0SOx+3/Tza9DqTKP7yfFlvuWiWzxOGqLA0WIyG+9mbWa4A7FDq9PO1UDPeg7/FRUzVxB8bMEmsCKdxLM6gu9W127pRggoxMRun8Yc/EF+9BScGxDB/OP8r8Z9zyFc7XsvZwGhxnnqROUw0Cah/yZknc8f+GwXxxvMMqNxsPlx7DMvvyOHafdVnJzGNB5q47MbvB7oOh2/pyhp+fZgWD54eXFuENB2zNAwV/r7uImrhfN4V9pyWQg2e32Q3GWYMNd/72kFtNStZhdY31rIAd5i0G7wcCPT9j8NB3k7wJ9U="
    - env:
      - REPOSITORY_NAME=hubat
      - RUMPEL=sandbox
      - ALT_RUMPEL=sandbox-react
    - env:
      - REPOSITORY_NAME=hubofallthings
      - RUMPEL=live
      - ALT_RUMPEL=live-react
      - secure: "<KEY>
      - secure: "<KEY> 


# Use sed to replace the SSH URL with the public URL, then initialize submodules
before_install:
  - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
  - git submodule update --init --recursive
  - 'curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"'
  - 'unzip awscli-bundle.zip'
  - './awscli-bundle/install -b $HOME/.local/bin/aws'

install:
  # - pip install --user awscli
  - export PATH=$PATH:$HOME/.local/bin

# Set up test database and user
# Copy the frontend assets from S3 to the right location
before_script:
  - psql -c "CREATE DATABASE testhatdb1;" -U postgres
  - psql -c "CREATE USER testhatdb1 WITH PASSWORD '<PASSWORD>';" -U postgres
  - psql -c "GRANT CREATE ON DATABASE testhatdb1 TO testhatdb1" -U postgres
  - |
    if [[ "$TRAVIS_PULL_REQUEST" = "false" || -z "$RUMPEL" ]]; then
      cd ./hat/app/org/hatdex/hat/phata/assets/
      aws s3 cp s3://${RUMPEL_BUCKET}/${RUMPEL} rumpel --recursive
      aws s3 cp s3://${RUMPEL_BUCKET}/${ALT_RUMPEL} alt-rumpel --recursive
      cp rumpel/*.js* js/
      cp rumpel/*.css stylesheets/
      gzip --keep --force js/*.bundle.js
      cp -r rumpel/assets/* .
      cp -r alt-rumpel/* .
      rm -r rumpel
      rm -r alt-rumpel
      cd -
    fi

{'fraction_non_alphanumeric': 0.12919850719744091, 'fraction_numerical': 0.027190332326283987, 'mean_word_length': 2.908333333333333, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1394512', 'n_tokens_mistral': 2528, 'n_tokens_neox': 2406, 'n_words': 428}