Remove odl-updates deps from copr repo
[releng/builder.git] / packer / provision / devstack-pre-pip.sh
1 #!/bin/bash
2
3 # force any errors to cause the script and job to end in failure
4 set -xeu -o pipefail
5
6 # Install xpath
7 yum install -y perl-XML-XPath python-pip python-six
8
9 # install crudini command line tool for editing config files
10 yum install -y crudini
11
12 echo '---> Installing non-baseline requirements'
13 yum install -y deltarpm nc python{,-{crypto,devel,lxml,setuptools}} \
14     @development {lib{xml2,xslt,ffi},openssl}-devel git wget
15
16 echo '---> Updating net link setup'
17 if [ ! -f /etc/udev/rules.d/80-net-setup-link.rules ]; then
18     ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
19 fi
20
21 echo '---> Pre-installing yum and pip packages'
22 projs="requirements keystone glance cinder neutron nova horizon"
23 # shellcheck disable=SC2154
24 branch=${os_branch}
25 # strip the "stable" off of the branch
26 branch_name=$(cut -d'/' -f2 <<< "${branch}")
27
28 # Do not upgrade pip to v10. v10 does not allow uninstalling
29 # distutils installed packages. This fails the openstack pip installs
30 # below when it attempts to uninstall packages.
31 # devstack patch that is trying to get pip 10 working:
32 # https://review.openstack.org/#/c/561597/
33 # wget https://bootstrap.pypa.io/get-pip.py
34 # python get-pip.py
35
36 mkdir tmp
37 cd tmp
38
39 git clone https://github.com/openstack-dev/devstack.git
40 (cd devstack && git checkout "${branch}")
41 sed -e 's/#.*//' devstack/files/rpms/general | xargs yum install -y
42
43 base_url=https://github.com/openstack/
44 for proj in $projs
45 do
46     git clone "${base_url}${proj}"
47     (cd "${proj}" && git checkout "${branch}")
48     pip install -c requirements/upper-constraints.txt -e "${proj}"
49     pip install -c requirements/upper-constraints.txt -r "${proj}/test-requirements.txt"
50 done
51
52 echo '---> Installing openvswitch from relevant openstack branch'
53 yum install -y "centos-release-openstack-${branch_name}"
54
55 # install 2.8.2 for queens.
56 # 2.9.0 is the current version in openstack-queens, but it is buggy.
57 # Remove this when https://review.rdoproject.org/r/#/c/13839/ merges and 2.9.2 is in the repo.
58 yum repolist
59 yum --showduplicates list openvswitch
60 if [ "${branch}" == "stable/queens" ]; then
61     yum install -y --nogpgcheck openvswitch-2.8.2-1.el7
62 else
63     yum install -y --nogpgcheck openvswitch
64 fi
65 cd "$OLDPWD"
66 rm -fr tmp
67
68 # vim: sw=4 ts=4 sts=4 et :