Do not publish docs when building fails

We just lost the docs.o.o index page: The tox run failed and only a
few files were ready. Since we delete existing content when pushing new,
this removed all our static pages.

Add a safe guard for all doc building: Only collect and publish
documents when we have build them with success. Add this to related
roles like creating/destroying afs as well.

Change-Id: Ife2496fe920bd40d52803705b409e6e621532254
This commit is contained in:
Andreas Jaeger
2017-10-26 13:13:05 +02:00
parent 4dbe1e5368
commit 30da877039
17 changed files with 67 additions and 0 deletions

View File

@@ -3,14 +3,20 @@
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/api-guide/build/html"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/api-guide/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- set-service-type-data-fact
when: zuul_success | bool
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/api-guide/{{ service_type_data.service_type }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -3,14 +3,20 @@
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/api-ref/build/html"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/api-ref/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- set-service-type-data-fact
when: zuul_success | bool
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/api-ref/{{ service_type_data.service_type }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -3,13 +3,18 @@
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/doc/build/html"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/doc/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/contributors"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -2,16 +2,22 @@
roles:
- prepare-docs-for-afs
doc_build_dir: "{{ zuul_work_dir }}/deploy-guide/build"
when: zuul_success | bool
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/deploy-guide/build/html"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/deploy-guide/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/project-deploy-guide/{{ zuul.project.short_name }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -1,6 +1,9 @@
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/infra/{{ zuul.project.short_name }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -3,13 +3,18 @@
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/docs-site/output"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "src/{{ zuul.project.canonical_name }}/docs-site/output/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/infra"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -1,6 +1,9 @@
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/infra/manual"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -2,16 +2,22 @@
roles:
- prepare-docs-for-afs
doc_build_dir: "{{ zuul_work_dir }}/install-guide/build"
when: zuul_success | bool
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/install-guide/build/html"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/install-guide/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/project-install-guide/{{ zuul.project.short_name }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -4,10 +4,14 @@
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/publish-docs/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -1,6 +1,9 @@
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/{{ zuul.project.short_name }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -4,6 +4,7 @@
- role: fetch-sphinx-output
sphinx_output_src: "src/{{ zuul.project.canonical_name }}/specs/output/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
@@ -19,3 +20,4 @@
src: "{{ zuul.executor.work_root }}/artifacts/"
dest: "/srv/static/specs/"
no_log: true
when: zuul_success | bool

View File

@@ -4,6 +4,7 @@
- role: fetch-sphinx-output
sphinx_output_src: "src/{{ zuul.project.canonical_name }}/doc/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
@@ -19,3 +20,4 @@
src: "{{ zuul.executor.work_root }}/artifacts/"
dest: "/srv/static/specs/{{ zuul.project.name }}"
no_log: true
when: zuul_success | bool

View File

@@ -3,13 +3,18 @@
- fetch-tox-output
- role: write-root-marker
root_marker_dir: "src/{{ zuul.project.canonical_name }}/placement-api-ref/build/html"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/placement-api-ref/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/api-ref/placement"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -4,13 +4,18 @@
tox_envlist: releasenotes
- role: write-root-marker
root_marker_dir: "{{ zuul.project.src_dir }}/releasenotes/build/html/"
when: zuul_success | bool
- role: fetch-sphinx-output
sphinx_output_src: "{{ zuul.project.src_dir }}/releasenotes/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
- create-afs-token
when: zuul_success | bool
- role: upload-afs
afs_target: "{{ afs.path }}/releasenotes/{{ zuul.project.short_name }}"
when: zuul_success | bool
- destroy-afs-token
when: zuul_success | bool

View File

@@ -4,6 +4,7 @@
- role: fetch-sphinx-output
sphinx_output_src: "src/{{ zuul.project.canonical_name }}/doc/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
@@ -19,3 +20,4 @@
src: "{{ zuul.executor.work_root }}/artifacts/"
dest: "/srv/static/service-types/"
no_log: true
when: zuul_success | bool

View File

@@ -4,6 +4,7 @@
- role: fetch-sphinx-output
sphinx_output_src: "src/{{ zuul.project.canonical_name }}/doc/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
@@ -17,3 +18,4 @@
copy:
src: "{{ zuul.executor.work_root }}/artifacts/"
dest: "{{ fileserver.path }}/{{ static_target }}/"
when: zuul_success | bool

View File

@@ -4,6 +4,7 @@
- role: fetch-sphinx-output
sphinx_output_src: "src/{{ zuul.project.canonical_name }}/doc/build/html/"
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
when: zuul_success | bool
- hosts: localhost
roles:
@@ -16,3 +17,4 @@
synchronize:
src: "{{ zuul.executor.work_root }}/artifacts/"
dest: "{{ fileserver.path }}/{{ zuul.project.short_name }}/"
when: zuul_success | bool