<commit_before>machine:
  pre:
    - sudo curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.6.2-circleci'; sudo chmod 0755 /usr/bin/docker; true
  services:
    - docker

checkout:
  post:
    - git fetch --unshallow 2>/dev/null || true
    - git fetch --tags
    # Nasty hack: Because we get a freshly restored repo, timestamps do not
    # correspond any more to when the file was last changed. To rectify this,
    # first set everything to a timestamp in the past and then update the
    # timestamp for all git-tracked files based on their last committed change.
    - find . -exec touch -t 201401010000 {} \;
    - for x in $(git ls-tree --full-tree --name-only -r HEAD); do touch -t $(date -d "$(git log -1 --format=%ci "${x}")" +%y%m%d%H%M.%S) "${x}"; done
  
dependencies:
  cache_directories:
    - "~/docker"

  override:
    - pip install docker-compose
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - docker build -t neurovault/neurovault .
    - mkdir -p ~/docker; docker save "neurovault/neurovault" > ~/docker/image.tar

test:
  override:
    - docker-compose run uwsgi python manage.py migrate
    - docker-compose run uwsgi python manage.py collectstatic --noinput
    - docker-compose run uwsgi python manage.py test


deployment:
  hub:
    branch: master
    commands:
      - docker push neurovault/neurovault<commit_msg>capture correct return codes<commit_after>machine:
  pre:
    - sudo curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.6.2-circleci'; sudo chmod 0755 /usr/bin/docker; true
  services:
    - docker
  
dependencies:
  cache_directories:
    - "~/docker"

  override:
    - pip install docker-compose
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - docker build -t neurovault/neurovault .
    - mkdir -p ~/docker; docker save "neurovault/neurovault" > ~/docker/image.tar

test:
  override:
    - docker-compose run --rm uwsgi bash -c "python manage.py collectstatic --noinput && python manage.py test"


deployment:
  hub:
    branch: master
    commands:
      - docker push neurovault/neurovault
{'fraction_non_alphanumeric': 0.12494300045599635, 'fraction_numerical': 0.01459188326493388, 'mean_word_length': 2.737649063032368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, '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': '6756872', 'n_tokens_mistral': 798, 'n_tokens_neox': 732, 'n_words': 224}