<commit_before>pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    when:
      event: pull_request
    restore: true
    mount:
      - ./pip-cache
      - ./node_modules
    volumes:
      - /tmp/cache:/cache

  test:
    image: registry.online.ntnu.no/dotkom/onlineweb4-testbase
    when:
      event: pull_request
    commands:
      - cp onlineweb4/settings/example-local.py onlineweb4/settings/local.py
      - npm install --depth=0 --quiet
      - pip install -r requirements.txt -r requirements-testing.txt --quiet --cache-dir pip-cache
      - npm run build:prod
      - npm run lint
      - isort -c -rc apps middleware scripts utils
      - flake8 apps middleware scripts utils
      - py.test --cov=apps
      - pip install codecov --quiet
      - codecov

  rebuild-cache:
    image: drillster/drone-volume-cache
    when:
      event: pull_request
    rebuild: true
    mount:
      - ./pip-cache
      - ./node_modules
    volumes:
      - /tmp/cache:/cache

  deploy:
    image: appleboy/drone-ssh
    host: nansen.online.ntnu.no
    port: 22
    user: root
    key: ${SSH_KEY}
    when:
      event: push
      branch: develop
    script:
      - /srv/www/ow4dev/deploy.sh<commit_msg>Get secrets from Drone<commit_after>pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    when:
      event: pull_request
    restore: true
    mount:
      - ./pip-cache
      - ./node_modules
    volumes:
      - /tmp/cache:/cache

  test:
    image: registry.online.ntnu.no/dotkom/onlineweb4-testbase
    when:
      event: pull_request
    commands:
      - cp onlineweb4/settings/example-local.py onlineweb4/settings/local.py
      - npm install --depth=0 --quiet
      - pip install -r requirements.txt -r requirements-testing.txt --quiet --cache-dir pip-cache
      - npm run build:prod
      - npm run lint
      - isort -c -rc apps middleware scripts utils
      - flake8 apps middleware scripts utils
      - py.test --cov=apps
      - pip install codecov --quiet
      - codecov

  rebuild-cache:
    image: drillster/drone-volume-cache
    when:
      event: pull_request
    rebuild: true
    mount:
      - ./pip-cache
      - ./node_modules
    volumes:
      - /tmp/cache:/cache

  deploy:
    image: appleboy/drone-ssh
    secrets: [ssh_key]
    host: nansen.online.ntnu.no
    port: 22
    user: root
    key: ${SSH_KEY}
    when:
      event: push
      branch: develop
    script:
      - /srv/www/ow4dev/deploy.sh
{'fraction_non_alphanumeric': 0.10404858299595142, 'fraction_numerical': 0.006477732793522267, 'mean_word_length': 1.92080378250591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '39352', 'n_tokens_mistral': 839, 'n_tokens_neox': 808, 'n_words': 190}