<commit_before>- name: Install dependencies
  package:
    name: "{{item}}"
    state: present
  with_items:
    - python3.5
    - nginx
    - python3-pip
- name: "Create system user {{app_user}}"
  user:
    name: "{{app_user}}"
    group: "{{app_group}}"
    create_home: yes
    shell: /bin/false
    system: yes
    home: "{{base_dir}}"
  become: yes
- name: Clone the application
  git:
    repo: https://github.com/FOSDEM/volunteers.git
    dest: "{{base_dir}}/tool"
    version: master
  become: yes
  become_user: "{{app_user}}"
  register: app_updated
  notify: Restart fosdem_volunteers
- name: Install dependencies inside a virtual environment
  pip:
    virtualenv: "{{base_dir}}/venv3"
    virtualenv_python: python3
    requirements: "{{base_dir}}/tool/requirements.txt"
  become: yes
  become_user: "{{app_user}}"
- name: Add gunicorn to venv
  pip:
    virtualenv: "{{base_dir}}/venv3"
    name: gunicorn
  become: yes
  become_user: "{{app_user}}"
- name: Create media directory
  file:
    path: "{{base_dir}}/tool/media/mugshots"
    state: directory
  become: yes
  become_user: "{{app_user}}"
- name: Check if localsettings exists
  stat:
    path: "{{ base_dir }}/tool/volunteer_mgmt"
  register: localsettings
- pause:
    prompt: "Please create localsettings.py in {{base_dir}}/tool/volunteer_mgmt"
  when: not localsettings.stat.exists
  notify: Restart fosdem_volunteers
- name: Run migrations
  django_manage:
    app_path: "{{base_dir}}/tool"
    command: migrate
    virtualenv: "{{base_dir}}/venv3"
  become: yes
  become_user: "{{app_user}}"
- name: Run migrations/Collect static files
  django_manage:
    app_path: "{{base_dir}}/tool"
    command: "{{ item }}"
    virtualenv: "{{base_dir}}/venv3"
  become: yes
  become_user: "{{app_user}}"
  with_items:
    - migrate
    - collect_static
  when: app_updated.changed
- name: Create systemd service file
  template:
    dest: /etc/systemd/system/fosdem_volunteers.service
    src: volunteers.service.j2
  become: yes
  notify: Restart fosdem_volunteers
- name: Install nginx configuration file
  template:
    dest: /etc/nginx/conf.d/fosdem_volunteers.conf
    src: nginx.conf.j2
  become: yes
  notify: Reload nginx<commit_msg>Fix typo and run migrations only once<commit_after>- name: Install dependencies
  package:
    name: "{{item}}"
    state: present
  with_items:
    - python3.5
    - nginx
    - python3-pip
- name: "Create system user {{app_user}}"
  user:
    name: "{{app_user}}"
    group: "{{app_group}}"
    create_home: yes
    shell: /bin/false
    system: yes
    home: "{{base_dir}}"
  become: yes
- name: Clone the application
  git:
    repo: https://github.com/FOSDEM/volunteers.git
    dest: "{{base_dir}}/tool"
    version: master
  become: yes
  become_user: "{{app_user}}"
  register: app_updated
  notify: Restart fosdem_volunteers
- name: Install dependencies inside a virtual environment
  pip:
    virtualenv: "{{base_dir}}/venv3"
    virtualenv_python: python3
    requirements: "{{base_dir}}/tool/requirements.txt"
  become: yes
  become_user: "{{app_user}}"
- name: Add gunicorn to venv
  pip:
    virtualenv: "{{base_dir}}/venv3"
    name: gunicorn
  become: yes
  become_user: "{{app_user}}"
- name: Create media directory
  file:
    path: "{{base_dir}}/tool/media/mugshots"
    state: directory
  become: yes
  become_user: "{{app_user}}"
- name: Check if localsettings exists
  stat:
    path: "{{ base_dir }}/tool/volunteer_mgmt"
  register: localsettings
- pause:
    prompt: "Please create localsettings.py in {{base_dir}}/tool/volunteer_mgmt"
  when: not localsettings.stat.exists
  notify: Restart fosdem_volunteers
- name: Run migrations/Collect static files
  django_manage:
    app_path: "{{base_dir}}/tool"
    command: "{{ item }}"
    virtualenv: "{{base_dir}}/venv3"
  become: yes
  become_user: "{{app_user}}"
  with_items:
    - migrate
    - collectstatic
  when: app_updated.changed
- name: Create systemd service file
  template:
    dest: /etc/systemd/system/fosdem_volunteers.service
    src: volunteers.service.j2
  become: yes
  notify: Restart fosdem_volunteers
- name: Install nginx configuration file
  template:
    dest: /etc/nginx/conf.d/fosdem_volunteers.conf
    src: nginx.conf.j2
  become: yes
  notify: Reload nginx
{'fraction_non_alphanumeric': 0.1264340903769609, 'fraction_numerical': 0.004448606883633809, 'mean_word_length': 3.5787781350482315, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2557908', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1520, 'n_words': 365}