<commit_before>sudo: required

services:
  - docker

dist: xenial

language: python
python:
  - "3.6"

install:
 - ./run --isolate --background
 - npm install -g apidoc
 - npm run apidoc
 - npm install -g eslint
 - pip install -r test/requirements.txt

script:
 - npm run lint
 - test/check-style
 - ./wait-for-api || { docker ps; docker logs cacophony-api; exit 1; }
 - cd test && pytest
# Apply migration undo and redo to test undo migration
 - docker exec -it cacophony-api /app-isolated/node_modules/.bin/sequelize db:migrate:undo --config /app-isolated/config/app_test_default.js --migrations-path /app-isolated/migrations
 - docker exec -it cacophony-api /app-isolated/node_modules/.bin/sequelize db:migrate:undo --config /app-isolated/config/app_test_default.js --migrations-path /app-isolated/migrations

before_deploy:
- version=${TRAVIS_TAG/v/}
# Install nfpm tool (for building debs)
- "curl -sL https://github.com/goreleaser/nfpm/releases/download/v0.9.5/nfpm_0.9.5_Linux_x86_64.tar.gz | tar -C /usr/bin -xzf -"
# Install json tool needed by build script
- npm install -g json
# Build release .deb<commit_msg>Put nfpm in different location<commit_after>sudo: required

services:
  - docker

dist: xenial

language: python
python:
  - "3.6"

install:
 - ./run --isolate --background
 - npm install -g apidoc
 - npm run apidoc
 - npm install -g eslint
 - pip install -r test/requirements.txt

script:
 - npm run lint
 - test/check-style
 - ./wait-for-api || { docker ps; docker logs cacophony-api; exit 1; }
 - cd test && pytest
# Apply migration undo and redo to test undo migration
 - docker exec -it cacophony-api /app-isolated/node_modules/.bin/sequelize db:migrate:undo --config /app-isolated/config/app_test_default.js --migrations-path /app-isolated/migrations
 - docker exec -it cacophony-api /app-isolated/node_modules/.bin/sequelize db:migrate:undo --config /app-isolated/config/app_test_default.js --migrations-path /app-isolated/migrations

before_deploy:
- version=${TRAVIS_TAG/v/}
# Install nfpm tool (for building debs)
- mkdir /tmp/nfpm
- "curl -sL https://github.com/goreleaser/nfpm/releases/download/v0.9.5/nfpm_0.9.5_Linux_x86_64.tar.gz | tar -C /tmp/nfpm -xzf -"
- export PATH=/tmp/nfpm:$PATH
# Install json tool needed by build script
- npm install -g json
# Build release .deb
{'fraction_non_alphanumeric': 0.12694974003466206, 'fraction_numerical': 0.011265164644714038, 'mean_word_length': 3.448940269749518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '702085', 'n_tokens_mistral': 883, 'n_tokens_neox': 833, 'n_words': 213}