Update build to put content into sphinx location

The publication job looks in doc/build/html but we're writing it to
publish/. Update the location ... and also add a success-url to the job
so we can verify the content.

Change-Id: I44de36fcac19a754ec107554b7a300dacd62aa3a
This commit is contained in:
Monty Taylor 2018-01-30 09:35:25 -06:00
parent d86f1821ce
commit e021ccb5ef
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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 = '''<div class="section" id="service-types-authority">
<h1>OpenStack Service Types Authority Data</h1>
<p>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