Support installing ironic-lib from source

Change-Id: I82b275222f0caeb69a605b8b56dc73f38242ff7a
This commit is contained in:
Dmitry Tantsur 2021-02-11 14:39:12 +01:00
parent 7e2ba37e4a
commit fef13dbc76
4 changed files with 24 additions and 0 deletions

View File

@ -10,6 +10,7 @@ export LC_ALL=C.UTF-8
SCRIPTDIR=$(dirname $0) SCRIPTDIR=$(dirname $0)
IPADIR=/tmp/ironic-python-agent IPADIR=/tmp/ironic-python-agent
IRLIBDIR=/tmp/ironic-lib
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
VENVDIR=/opt/ironic-python-agent VENVDIR=/opt/ironic-python-agent
# 19.1.1 is required for cryptography. # 19.1.1 is required for cryptography.
@ -52,6 +53,11 @@ $VENVDIR/bin/pip install -c $UPPER_CONSTRAINTS $IPADIR
ln -s $VENVDIR/bin/ironic-python-agent /usr/local/bin/ ln -s $VENVDIR/bin/ironic-python-agent /usr/local/bin/
ln -s $VENVDIR/bin/ironic-collect-introspection-data /usr/local/bin/ ln -s $VENVDIR/bin/ironic-collect-introspection-data /usr/local/bin/
# install ironic-lib from source if requested
if [ ${IRONIC_LIB_FROM_SOURCE:-false} == "true" ]; then
$VENVDIR/bin/pip install -c $UPPER_CONSTRAINTS -r $IRLIBDIR/requirements.txt
$VENVDIR/bin/pip install $IRLIBDIR
fi
case "$DIB_INIT_SYSTEM" in case "$DIB_INIT_SYSTEM" in
upstart) upstart)

View File

@ -0,0 +1 @@
ironic-lib git /tmp/ironic-lib https://opendev.org/openstack/ironic-lib

View File

@ -76,6 +76,14 @@ To use a specific branch of ironic-python-agent, use:
export DIB_REPOREF_ironic_python_agent=origin/stable/queens export DIB_REPOREF_ironic_python_agent=origin/stable/queens
export DIB_REPOREF_requirements=origin/stable/queens export DIB_REPOREF_requirements=origin/stable/queens
To build ironic-lib from source, do:
.. code-block:: bash
export IRONIC_LIB_FROM_SOURCE=true
# Optionally:
#export DIB_REPOREF_ironic_lib=<branch>
To build image for architectures other than amd64, you can either set the To build image for architectures other than amd64, you can either set the
``ARCH`` environment variable or use ``-a`` to specify the target ``ARCH`` environment variable or use ``-a`` to specify the target
architecture: architecture:

View File

@ -0,0 +1,9 @@
---
features:
- |
Supports installing ironic-lib from source in the DIB build. Set
::
export IRONIC_LIB_FROM_SOURCE=true
to use.