create dummy index on new import

Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Goncharov, Artem argoncha <artem.goncharov@t-systems.com>
Co-committed-by: Goncharov, Artem argoncha <artem.goncharov@t-systems.com>
This commit is contained in:
Goncharov, Artem argoncha 2022-07-25 17:14:34 +00:00 committed by zuul
parent 252189f486
commit d30453af0d
3 changed files with 42 additions and 37 deletions

View File

@ -264,6 +264,11 @@ class OTCDocConvertor:
logging.warning(
f"CLASS.TXT.json file is missing in {self.args.path}, "
f"assuming initial import")
with open(pathlib.Path(dest, "index.rst"), "w") as index:
index.write('=' * (len(self.args.title)) + '\n')
index.write(self.args.title + '\n')
index.write('=' * (len(self.args.title)) + '\n')
index.write('\n')
sys.exit(0)
meta_data = json.loads(open(metadata_file).read())
metadata_by_uri = dict()

View File

@ -10,8 +10,8 @@
vars:
fetch_doc_artifacts_name: "{{ doc.label }}"
fetch_doc_artifacts_rst_source: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}/{{ docs_new_location }}"
fetch_doc_artifacts_diff_patch: "{{ ansible_user_dir }}/{{ doc.label }}.patch"
fetch_doc_artifacts_git_patch: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch"
# fetch_doc_artifacts_diff_patch: "{{ ansible_user_dir }}/{{ doc.label }}.patch"
# fetch_doc_artifacts_git_patch: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch"
loop: "{{ docs }}"
loop_control:
loop_var: "doc"

View File

@ -35,38 +35,38 @@
label: "{{ doc.label }}"
when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor') or git_log.stdout is search('playbooks')"
- name: Restore to the previous git state
command: "git checkout HEAD^1"
args:
chdir: "{{ zuul.project.src_dir }}"
- name: Generate base RSTs
include_role:
name: "convert_doc"
vars:
doc_label: "{{ doc.label }}"
dest: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}/{{ docs_base_location }}"
source: "{{ zuul.project.src_dir }}/{{ doc.html_location }}"
loop: "{{ docs }}"
loop_control:
loop_var: "doc"
label: "{{ doc.label }}"
when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')"
- name: Generate patch file
include_role:
name: "generate_doc_patch"
vars:
doc_label: "{{ doc.label }}"
generate_doc_patch_base_location: "{{ docs_base_location }}"
generate_doc_patch_new_location: "{{ docs_new_location }}"
generate_doc_patch_repository: "{{ doc.repository }}"
generate_doc_patch_project_location: "{{ doc.project_location }}"
generate_doc_patch_base: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}"
generate_doc_patch_diff_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.patch"
generate_doc_patch_git_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch"
loop: "{{ docs }}"
loop_control:
loop_var: "doc"
label: "{{ doc.label }}"
when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')"
# - name: Restore to the previous git state
# command: "git checkout HEAD^1"
# args:
# chdir: "{{ zuul.project.src_dir }}"
#
# - name: Generate base RSTs
# include_role:
# name: "convert_doc"
# vars:
# doc_label: "{{ doc.label }}"
# dest: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}/{{ docs_base_location }}"
# source: "{{ zuul.project.src_dir }}/{{ doc.html_location }}"
# loop: "{{ docs }}"
# loop_control:
# loop_var: "doc"
# label: "{{ doc.label }}"
# when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')"
#
# - name: Generate patch file
# include_role:
# name: "generate_doc_patch"
# vars:
# doc_label: "{{ doc.label }}"
# generate_doc_patch_base_location: "{{ docs_base_location }}"
# generate_doc_patch_new_location: "{{ docs_new_location }}"
# generate_doc_patch_repository: "{{ doc.repository }}"
# generate_doc_patch_project_location: "{{ doc.project_location }}"
# generate_doc_patch_base: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}"
# generate_doc_patch_diff_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.patch"
# generate_doc_patch_git_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch"
# loop: "{{ docs }}"
# loop_control:
# loop_var: "doc"
# label: "{{ doc.label }}"
# when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')"