
Sphinx jobs and reno jobs need basically the same thing for dependencies. So make a new role, ensure-sphinx, which is parameterizable enough that it can be used by both reno and sphinx jobs. Make build jobs for both releasenotes and sphinx docs, as both of these things are perfectly valid things to do in both OpenStack and non-OpenStack contexts. We'll add an openstack specific job in openstack-zuul-jobs that uses these as parents but adds the requirements repo and constraints file settings. Some of the pip commands here can be improved once https://github.com/ansible/ansible/pull/33098 lands and is released, which would allow specifying --user and -c as parameters to the pip module. Change-Id: Idd7caf7d88b56d61872906027b4ce7d743572ded Needed-By: I57de14580f39b9e1c11a587b51b44b61b02c84da
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
# TODO(mordred) Make this a list of known binary depends that sphinx needs
|
|
- name: Install gettext package
|
|
package:
|
|
name: gettext
|
|
state: present
|
|
become: yes
|
|
|
|
- name: Find Constraints File
|
|
include_role:
|
|
name: find-constraints
|
|
|
|
- name: Install virtualenv and doc requirements files if found
|
|
shell:
|
|
executable: /bin/bash
|
|
chdir: "{{ zuul_work_dir }}"
|
|
# NOTE(mordred) There is a bug in ansible-lint that mistakenly detects
|
|
# setting the VENV variable below as an error if it occurs on the fist
|
|
# line. Work around that by putting a comment as the first line until we
|
|
# can get a fix upstream.
|
|
cmd: |
|
|
# Create virtualenv is it does not already exist
|
|
VENV={{ zuul_work_virtualenv }}
|
|
if [ ! -d $VENV ] ; then
|
|
virtualenv $VENV
|
|
fi
|
|
source $VENV/bin/activate
|
|
# skipping requirements.txt as it gets picked up by installing the
|
|
# python package itself
|
|
for f in docs/requirements.txt test-requirements.txt ; do
|
|
if [ -f $f ] ; then
|
|
pip install $CONSTRAINTS -r $f
|
|
break
|
|
fi
|
|
done
|
|
environment:
|
|
CONSTRAINTS: "{{ upper_constraints|default('') }}"
|
|
|
|
- name: Install doc building packages
|
|
pip:
|
|
name: "{{ item }}"
|
|
chdir: "{{ zuul_work_dir }}"
|
|
virtualenv: "{{ zuul_work_virtualenv }}"
|
|
extra_args: "{{ upper_constraints|default(omit) }}"
|
|
with_items: "{{ doc_building_packages }}"
|