1
0
forked from docs/doc-exports
doc-exports/playbooks/compare.yaml
gtema 7821fdbd24 Add job for comparing doc content to the current
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2022-10-19 12:57:39 +00:00

31 lines
1.0 KiB
YAML

---
- hosts: all
tasks:
- name: Read project docs configuration
ansible.builtin.include_vars: "{{ docs_update_data_file }}"
- name: Detect list of changes
ansible.builtin.command: "git log -1 --name-only --pretty="
args:
chdir: "{{ zuul.project.src_dir }}"
register: git_log
ignore_errors: true
changed_when: false
- name: Verify document matches the one in the current HC
ansible.builtin.include_role:
name: "compare"
vars:
compare_html_location: "{{ doc.1.html_location }}"
compare_hc_location: "{{ doc.1.hc_location }}"
doc_label: "{{ doc.0.service_type }}_{{ doc.1.type }}"
loop: "{{ categories | json_query('*') | flatten | subelements('docs') }}"
loop_control:
loop_var: "doc"
label: "{{ doc.0.service_type }}_{{ doc.1.type }}"
when:
- "doc.1.html_location is defined"
- "doc.1.hc_location is defined"
- |
git_log.stdout is search(doc.1.html_location)