<commit_before>---
# Tests for git strategy
- name: Given no previous deploy with Git
  hosts: all
  vars:
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  tasks:
    - name: Assert ansistrano_deploy_to path does not exist
      stat:
        path: "{{ ansistrano_deploy_to }}"
      register: st
    - debug:
        msg: "Path does not exist and is a directory"
      when: st.stat.exists is defined and not st.stat.exists

- name: When deploying using Git
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/deploy.git
    ansistrano_git_branch: master
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  roles:
    - { role: local-ansistrano }

- name: Then a successful deploy with git should be done
  hosts: all
  vars:
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  tasks:
    - name: Assert ansistrano_deploy_to path does exist
      stat:
        path: "{{ ansistrano_deploy_to }}"
      register: st
    - debug:
        msg: "Path exists and is a directory"
      when: st.stat.exists is defined and st.stat.exists

- name: And I should be able to do a second deploy
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/deploy.git
    ansistrano_git_branch: master
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  roles:
    - { role: local-ansistrano }

- name: When deploying using Git (repo_tree with Single-Layer folder)
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/deploy.git
    ansistrano_git_branch: master
    ansistrano_git_repo_tree: test
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  pre_tasks:
    - name: Clear ansistrano_deploy_to
      file:
        path: "{{ ansistrano_deploy_to }}"
        state: absent
  roles:
    - { role: local-ansistrano }
  tasks:
    - name: Assert ansistrano_deploy_to/current/main.yml file does exist
      stat:
        path: "{{ ansistrano_deploy_to }}/current/main.yml"
      register: st
    - fail:
        msg: "File not exists"
      when: st.stat.exists is not defined or st.stat.exists == False or st.stat.isdir == True

- name: When deploying using Git (repo_tree with Multi-Layer folder)
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/deploy.git
    ansistrano_git_branch: master
    ansistrano_git_repo_tree: test/roles/
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  pre_tasks:
    - name: Clear ansistrano_deploy_to
      file:
        path: "{{ ansistrano_deploy_to }}"
        state: absent
  roles:
    - { role: local-ansistrano }
  tasks:
    - name: Assert ansistrano_deploy_to/current/local-ansistrano symbolic link does exist
      stat:
        path: "{{ ansistrano_deploy_to }}/current/local-ansistrano"
      register: st
    - fail:
        msg: "Symbolic link not exists"
      when: st.stat.exists is not defined or st.stat.exists == False or st.stat.islnk == False
<commit_msg>use new repos to test git<commit_after>---
# Tests for git strategy
- name: Given no previous deploy with Git
  hosts: all
  vars:
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  tasks:
    - name: Assert ansistrano_deploy_to path does not exist
      stat:
        path: "{{ ansistrano_deploy_to }}"
      register: st
    - debug:
        msg: "Path does not exist and is a directory"
      when: st.stat.exists is defined and not st.stat.exists

- name: When deploying using Git
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/git-test.git
    ansistrano_git_branch: master
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  roles:
    - { role: local-ansistrano }

- name: Then a successful deploy with git should be done
  hosts: all
  vars:
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  tasks:
    - name: Assert ansistrano_deploy_to path does exist
      stat:
        path: "{{ ansistrano_deploy_to }}"
      register: st
    - debug:
        msg: "Path exists and is a directory"
      when: st.stat.exists is defined and st.stat.exists

- name: And I should be able to do a second deploy
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/git-test.git
    ansistrano_git_branch: master
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  roles:
    - { role: local-ansistrano }

- name: When deploying using Git (repo_tree with Single-Layer folder)
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/git-test.git
    ansistrano_git_branch: master
    ansistrano_git_repo_tree: foo
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  pre_tasks:
    - name: Clear ansistrano_deploy_to
      file:
        path: "{{ ansistrano_deploy_to }}"
        state: absent
  roles:
    - { role: local-ansistrano }
  tasks:
    - name: Assert ansistrano_deploy_to/current/bar.html file does exist
      stat:
        path: "{{ ansistrano_deploy_to }}/current/bar.html"
      register: st
    - fail:
        msg: "File bar.html does not exist"
      when: st.stat.exists is not defined or st.stat.exists == False or st.stat.isdir == True

- name: When deploying using Git (repo_tree with Multi-Layer folder)
  hosts: all
  vars:
    ansistrano_deploy_via: "git"
    ansistrano_git_repo: https://github.com/ansistrano/git-test.git
    ansistrano_git_branch: master
    ansistrano_git_repo_tree: foo/baz/
    ansistrano_deploy_to: "/tmp/git/my-app.com"
  pre_tasks:
    - name: Clear ansistrano_deploy_to
      file:
        path: "{{ ansistrano_deploy_to }}"
        state: absent
  roles:
    - { role: local-ansistrano }
  tasks:
    - name: Assert ansistrano_deploy_to/current/sub.html file does exist
      stat:
        path: "{{ ansistrano_deploy_to }}/current/sub.html"
      register: st
    - fail:
        msg: "File sub.html does not exist"
      when: st.stat.exists is not defined or st.stat.exists == False or st.stat.isdir == True

{'fraction_non_alphanumeric': 0.09945300845350571, 'fraction_numerical': 0.0, 'mean_word_length': 2.8093434343434343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, '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': '1245997', 'n_tokens_mistral': 2104, 'n_tokens_neox': 2053, 'n_words': 527}