diff --git a/.zuul.yaml b/.zuul.yaml index f9e0535..49af61b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -14,5 +14,7 @@ Run tests for service-types-authority project. Uses tox with the ``publish`` environment. + success-url: html/ + post-run: playbooks/fetch-publish-output.yaml vars: tox_envlist: publish diff --git a/playbooks/fetch-publish-output.yaml b/playbooks/fetch-publish-output.yaml new file mode 100644 index 0000000..a2d51d5 --- /dev/null +++ b/playbooks/fetch-publish-output.yaml @@ -0,0 +1,6 @@ +- hosts: all + roles: + - role: fetch-sphinx-output + sphinx_output_src: "{{ zuul.project.src_dir }}/doc/build/html" + zuul_executor_dest: "{{ zuul.executor.log_root }}" + when: zuul_success | bool diff --git a/publish.py b/publish.py index 28969b5..487504e 100644 --- a/publish.py +++ b/publish.py @@ -24,7 +24,7 @@ import requests HTTP_LOCATION = 'https://service-types.openstack.org/service-types.json' SPECS_BASE = 'http://specs.openstack.org/openstack' -OUTDIR = 'publish' +OUTDIR = 'doc/build/html' HEADER = '''

OpenStack Service Types Authority Data

For more information on the files, see: @@ -108,7 +108,7 @@ def main(): shutil.copyfile(filename, os.path.join(OUTDIR, filename)) latest_file = 'service-types.json.{version}'.format(version=latest_version) - with open('publish/HEADER.html', 'w') as header: + with open('{outdir}/HEADER.html'.format(outdir=OUTDIR), 'w') as header: header.write(HEADER.format(latest_file=latest_file, specs_base=SPECS_BASE)) return 0