Allow looking constraints file from env var

In order to make it more flexible, and to consume the upper
constraints file from the right branch, allow to consume an
exported var, and default to the current path.

Change-Id: I57ef2944f4c2b643d240f30cac46ad91662ff538
This commit is contained in:
Yolanda Robla 2017-03-31 09:26:28 +02:00
parent 6109f824e5
commit 34bccf2fa4
8 changed files with 20 additions and 5 deletions

View File

@ -248,6 +248,11 @@ Note:
playbook due to the fact that is an IO-intensive operation that can
take a great deal of time.
- In order to cap requirements for installation, an ``upper_constraints_file``
setting is defined. This is consuming the ``UPPER_CONSTRAINTS_FILE`` env
var by default, to properly integrate with CI systems, and will default
to ``/opt/stack/requirements/upper-constraints.txt`` file if not present.
Manually test with Virtual Machines
===================================

View File

@ -76,6 +76,7 @@ ironicclient_git_folder: /opt/stack/python-ironicclient
shade_git_folder: /opt/stack/shade
dib_git_folder: /opt/stack/diskimage-builder
reqs_git_folder: /opt/stack/requirements
upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}"
staging_drivers_git_folder: /opt/stack/ironic-staging-drivers
ironicinspector_git_folder: /opt/stack/ironic-inspector
ironicinspectorclient_git_folder: /opt/stack/python-ironic-inspector-client

View File

@ -19,7 +19,7 @@
state=latest
sourcedir={{ ironicinspector_git_folder }}
source_install={{ ironicinspector_source_install }}
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ reqs_git_folder }}/upper-constraints.txt"
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ upper_constraints_file }}"
- name: "Inspector - PIP client install"
include: pip_install.yml
@ -27,4 +27,4 @@
state=latest
source_dir={{ ironicinspectorclient_git_folder }}
sourc_install={{ ironicinspectorclient_source_install }}
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ reqs_git_folder }}/upper-constraints.txt"
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ upper_constraints_file }}"

View File

@ -113,7 +113,7 @@
state=latest
sourcedir={{ ironic_git_folder }}
source_install=true
extra_args="--no-cache-dir --upgrade -c {{ reqs_git_folder }}/upper-constraints.txt"
extra_args="--no-cache-dir --upgrade -c {{ upper_constraints_file }}"
when: skip_install is not defined
- name: "Install ironic-inspector to permit use of inspection interface"

View File

@ -19,4 +19,4 @@
state=latest
sourcedir={{ staging_drivers_git_folder }}
source_install={{ staging_drivers_source_install }}
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ reqs_git_folder }}/upper-constraints.txt"
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ upper_constraints_file }}"

View File

@ -44,5 +44,5 @@
state=latest
sourcedir={{ keystone_git_folder }}
source_install={{ keystone_source_install | bool }}
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ reqs_git_folder }}/upper-constraints.txt"
extra_args="--no-cache-dir --upgrade --force-reinstall -c {{ upper_constraints_file }}"
when: skip_install is not defined

View File

@ -19,6 +19,7 @@ ironicinspectorclient_git_folder: "{{ git_root}}/python-ironic-inspector-client"
shade_git_folder: "{{ git_root}}/shade"
dib_git_folder: "{{ git_root }}/diskimage-builder"
reqs_git_folder: "{{ git_root }}/requirements"
upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}"
staging_drivers_git_folder: "{{ git_root }}/ironic-staging-drivers"
keystone_git_folder: "{{ git_root}}/keystone"
# *_git_branch can be overridden for stable branch testing

View File

@ -0,0 +1,8 @@
---
features:
- Allow consuming upper_constraints_file from an env
var UPPER_CONSTRAINTS_FILE. This will be specially
useful for OpenStack CI, where this var is defined
on each job run, pointing to the right requirements
file depending on branch.