Ansible job definitions for Zuul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.yaml 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. - name: By default, we use standard doc dir
  2. set_fact:
  3. use_doc_dir: true
  4. - name: Check if sphinx_source_dir was changed
  5. set_fact:
  6. use_doc_dir: false
  7. when: sphinx_source_dir != "doc/source"
  8. - name: Attempt to get warning-is-error from config file
  9. when:
  10. - use_doc_dir
  11. - sphinx_warning_is_error is not defined
  12. sphinx_check_warning_is_error:
  13. project_dir: "{{ zuul_work_dir }}"
  14. register: check_result
  15. - name: Set sphinx_warning_is_error
  16. when:
  17. - use_doc_dir
  18. - sphinx_warning_is_error is not defined
  19. set_fact:
  20. sphinx_warning_is_error: "{{ check_result.warning_is_error }}"
  21. sphinx_pbr_autodoc: "{{ check_result.autodoc_index_modules }}"
  22. - name: Set sphinx_warning_is_error
  23. when:
  24. - not use_doc_dir
  25. - sphinx_warning_is_error is not defined
  26. set_fact:
  27. # Non-default dirs always enable warnings
  28. sphinx_warning_is_error: true
  29. sphinx_pbr_autodoc: false
  30. - name: Run sphinx
  31. shell:
  32. executable: /bin/bash
  33. cmd: |
  34. # Source the activate file so that sphinx subcommands have the correct
  35. # paths set.
  36. source {{ zuul_work_virtualenv }}/bin/activate
  37. sphinx-build -b {{ item }} \
  38. {% if sphinx_warning_is_error %} -W {% endif %} \
  39. {{ sphinx_source_dir }} {{ sphinx_build_dir }}/{{ item }}
  40. chdir: "{{ zuul_work_dir }}"
  41. with_items: "{{ sphinx_builders }}"
  42. when:
  43. - not use_doc_dir or not sphinx_pbr_autodoc
  44. # TODO(mordred) Remove this when we get projects off of the pbr autoindex
  45. - name: Run sphinx using legacy pbr runner
  46. shell:
  47. executable: /bin/bash
  48. cmd: |
  49. # Source the activate file so that sphinx subcommands have the correct
  50. # paths set.
  51. source {{ zuul_work_virtualenv }}/bin/activate
  52. python setup.py build_sphinx
  53. chdir: "{{ zuul_work_dir }}"
  54. when:
  55. - use_doc_dir
  56. - sphinx_pbr_autodoc
  57. - name: Check for whereto
  58. stat:
  59. path: "{{ zuul_work_virtualenv }}/bin/whereto"
  60. get_checksum: false
  61. get_mime: false
  62. get_md5: false
  63. register: whereto
  64. - name: Check for htaccess
  65. stat:
  66. path: "{{ zuul_work_dir }}/{{ sphinx_source_dir }}/_extra/.htaccess"
  67. get_checksum: false
  68. get_mime: false
  69. get_md5: false
  70. register: htaccess
  71. - name: Run whereto
  72. command:
  73. cmd: "{{ whereto.stat.path }} {{ sphinx_source_dir }}/_extra/.htaccess doc/test/redirect-tests.txt"
  74. chdir: "{{ zuul_work_dir }}"
  75. when:
  76. - whereto.stat.exists
  77. - htaccess.stat.exists
  78. - use_doc_dir