Apply upper-constraints when building venvs

When building a venv for leap upgrades, checkout the applicable
requirements repo SHA and apply its upper-constraints file. If
packages within the venv are installed unconstrained, a project's
database migration scripts may fail.

Also remove tempest from being built within the venv.

Change-Id: Ic7e9aaa2d445bfe22c0f707a00a867cc8e84a38d
This commit is contained in:
Jimmy McCrory 2017-04-07 23:41:59 -07:00
parent 33da8fc8eb
commit c4526c0a61

View File

@ -281,9 +281,23 @@ function build_venv {
import json
packages = json.loads("""$PKG_DUMP""")
remote_packages = packages[0]['remote_packages']
print(' '.join([i for i in remote_packages if 'openstack' in i]))
print(' '.join([i for i in remote_packages if 'openstack' in i and 'tempest' not in i]))
EOC)
pip install --isolated $PACKAGES
REQUIREMENTS=($(python <<EOC
import json
packages = json.loads("""$PKG_DUMP""")
remote_package_parts = packages[0]['remote_package_parts']
requirements = filter(lambda package: package['name'] == 'requirements', remote_package_parts)
print(requirements[0]['url'])
print(requirements[0]['version'])
EOC))
git clone ${REQUIREMENTS[0]} "/opt/leap42/openstack-ansible-$1/requirements"
pushd "/opt/leap42/openstack-ansible-$1/requirements"
git checkout ${REQUIREMENTS[1]}
popd
pip install --isolated $PACKAGES --constraint "/opt/leap42/openstack-ansible-$1/requirements/upper-constraints.txt"
deactivate
# Create venv archive