
Follow I1334ff1f469061884b222dd99e72a989d72c68be and fail if constraints_file contains a file name that does not exist. Change-Id: I220bddabf24be5773c835635473e4b90e474eb09
74 lines
2.4 KiB
YAML
74 lines
2.4 KiB
YAML
- name: Install gettext package
|
|
package:
|
|
name: gettext
|
|
state: present
|
|
become: yes
|
|
|
|
- name: Check to see if the constraints file exists
|
|
stat:
|
|
path: "{{ constraints_file }}"
|
|
get_checksum: false
|
|
get_mime: false
|
|
get_md5: false
|
|
register: stat_results
|
|
when: constraints_file is defined
|
|
|
|
- name: Fail if constraints file does not exist
|
|
fail:
|
|
msg: "Variable constraints_file is set but file does not exist."
|
|
when:
|
|
- constraints_file is defined
|
|
- not stat_results|skipped and not stat_results.stat.exists
|
|
|
|
- name: Record file location
|
|
set_fact:
|
|
upper_constraints: "-c {{ constraints_file }}"
|
|
when: not stat_results|skipped and stat_results.stat.exists
|
|
|
|
- name: Setup venv
|
|
shell:
|
|
chdir: '{{ zuul_work_dir }}'
|
|
executable: /bin/bash
|
|
cmd: |
|
|
set -e
|
|
set -x
|
|
|
|
OPTIONAL_REQUIREMENTS_SOURCES="
|
|
docs/requirements.txt
|
|
requirements.txt
|
|
test-requirements.txt
|
|
"
|
|
|
|
UPPER_CONSTRAINTS="{{ upper_constraints }}"
|
|
# NOTE(dhellmann): Place the virtualenv in $HOME because
|
|
# that is where the build-releasenotes task expects to find it.
|
|
python -m virtualenv $HOME/.venv
|
|
VENV=$HOME/.venv/bin
|
|
$VENV/pip install sphinx $UPPER_CONSTRAINTS
|
|
$VENV/pip install openstackdocstheme $UPPER_CONSTRAINTS
|
|
$VENV/pip install reno $UPPER_CONSTRAINTS
|
|
|
|
# Install from other optional sources, ignoring errors.
|
|
# TODO(jaegerandi): as below, these extra requirements are only
|
|
# for things like oslosphix which some releasenotes jobs still
|
|
# depend on.
|
|
for reqfile in $OPTIONAL_REQUIREMENTS_SOURCES; do
|
|
if [ -e $reqfile ] ; then
|
|
$VENV/pip install -r $reqfile $UPPER_CONSTRAINTS || true
|
|
fi
|
|
done
|
|
|
|
# Optionally, install local requirements
|
|
if [ -e releasenotes/requirements.txt ] ; then
|
|
$VENV/pip install -r releasenotes/requirements.txt $UPPER_CONSTRAINTS
|
|
fi
|
|
# TODO(jaegerandi): Remove once all repos are fixed.
|
|
# Try installing current repo in case it needs to be available for
|
|
# example for version number calculation. Ignore any failures here.
|
|
if [ -f setup.cfg ] ; then
|
|
# NOTE(dhellmann): We do *NOT* use constraints here because
|
|
# that makes it impossible to install anything that is listed
|
|
# in the constraints list.
|
|
$VENV/pip install . || true
|
|
fi
|