<commit_before>{% set app_name = pillar.get('app_name', 'app_name') %}
{% set app_user = pillar.get('app_user', pillar.get('login_user', 'root')) %}

app-directory:
  file.directory:
    - name: /srv/{{ pillar.get('app_directory_name', app_name) }}
    - user: {{ app_user }}
    - group: {{ app_user }}
    - makedirs: true

git-clone-key:
  file.managed:
    - contents_pillar: github_key
    - name: /etc/ssh/git.{{ grains['host'] }}.pky
    - user: {{ app_user }}
    - group: {{ app_user }}
    - mode: 600

git-clone-app:
  git.latest:
    - name: <EMAIL>:{{ pillar['app_repo'] }}.git
    {% if pillar.get('app_repo_rev', false) %}
    - rev: {{ pillar['app_repo_rev'] }}
    {% endif %}
    - target: /srv/{{ pillar.get('app_directory_name', app_name) }}
    - identity: /etc/ssh/git.{{ grains['host'] }}.pky
    - user: {{ app_user }}
    - require:
      - pkg: git
      - file: git-clone-key
      - file: app-directory

{% if pillar.get('upstream_repo', false) %}
git-app-add-upstream:
  cmd.run:
    - name: git remote add upstream <EMAIL>:{{ pillar['upstream_repo'] }}
    - unless: git remote | grep upstream
    - cwd: /srv/{{ app_name }}
    - user: {{ app_user }}
    - group: {{ app_user }}
    - require:
      - git: git-clone-app
{% endif %}<commit_msg>app.source: always fetch submodules in git.latest<commit_after>{% set app_name = pillar.get('app_name', 'app_name') %}
{% set app_user = pillar.get('app_user', pillar.get('login_user', 'root')) %}

app-directory:
  file.directory:
    - name: /srv/{{ pillar.get('app_directory_name', app_name) }}
    - user: {{ app_user }}
    - group: {{ app_user }}
    - makedirs: true

git-clone-key:
  file.managed:
    - contents_pillar: github_key
    - name: /etc/ssh/git.{{ grains['host'] }}.pky
    - user: {{ app_user }}
    - group: {{ app_user }}
    - mode: 600

git-clone-app:
  git.latest:
    - name: <EMAIL>:{{ pillar['app_repo'] }}.git
    {% if pillar.get('app_repo_rev', false) %}
    - rev: {{ pillar['app_repo_rev'] }}
    {% endif %}
    - target: /srv/{{ pillar.get('app_directory_name', app_name) }}
    - identity: /etc/ssh/git.{{ grains['host'] }}.pky
    - submodules: true
    - user: {{ app_user }}
    - require:
      - pkg: git
      - file: git-clone-key
      - file: app-directory

{% if pillar.get('upstream_repo', false) %}
git-app-add-upstream:
  cmd.run:
    - name: git remote add upstream <EMAIL>:{{ pillar['upstream_repo'] }}
    - unless: git remote | grep upstream
    - cwd: /srv/{{ app_name }}
    - user: {{ app_user }}
    - group: {{ app_user }}
    - require:
      - git: git-clone-app
{% endif %}
{'fraction_non_alphanumeric': 0.19662706017631276, 'fraction_numerical': 0.0022997316979685703, 'mean_word_length': 2.696883852691218, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '54549', 'n_tokens_mistral': 1021, 'n_tokens_neox': 948, 'n_words': 193}