a91d7619d68d843467b6a73d0153f402bf5189e9
[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 # add in a test copr repo
7 wget http://copr.fedoraproject.org/coprs/tykeal/odl-updates/repo/epel-7/tykeal-odl-updates-epel-7.repo -O /etc/yum.repos.d/tykeal-odl-updates-epel-7.repo
8 # Install xpath
9 yum install -y perl-XML-XPath python-pip python-six
10
11 # install crudini command line tool for editing config files
12 yum install -y crudini
13
14 echo '---> Installing non-baseline requirements'
15 yum install -y deltarpm nc python{,-{crypto,devel,lxml,setuptools}} \
16     @development {lib{xml2,xslt,ffi},openssl}-devel git wget
17
18 echo '---> Updating net link setup'
19 if [ ! -f /etc/udev/rules.d/80-net-setup-link.rules ]; then
20     ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
21 fi
22
23 echo '---> Pre-installing yum and pip packages'
24 projs="requirements keystone glance cinder neutron nova horizon"
25 branch=${os_branch}
26
27 wget https://bootstrap.pypa.io/get-pip.py
28 python get-pip.py
29
30 mkdir tmp
31 cd tmp
32
33 git clone https://github.com/openstack-dev/devstack.git
34 (cd devstack && git checkout ${branch})
35 sed -e 's/#.*//' devstack/files/rpms/general | xargs yum install -y
36
37 base_url=https://github.com/openstack/
38 for proj in $projs
39 do
40     git clone ${base_url}${proj}
41     (cd ${proj} && git checkout ${branch})
42     pip install -c requirements/upper-constraints.txt -e ${proj}
43     pip install -c requirements/upper-constraints.txt -r ${proj}/test-requirements.txt
44 done
45
46 if [ "$branch" == "stable/mitaka" ] || [ "$branch" == "stable/liberty" ]; then
47     # the newton release has ovs 2.5.0
48     echo '---> Installing openvswitch from openstack Newton repo (2.5.0)'
49     yum install -y http://rdoproject.org/repos/openstack-newton/rdo-release-newton.rpm
50 else
51     # the ocata release has ovs 2.6.1
52     echo '---> Installing openvswitch from openstack Ocata repo (2.6.1)'
53     yum install -y http://rdoproject.org/repos/openstack-ocata/rdo-release-ocata.rpm
54 fi
55
56 yum install -y --nogpgcheck openvswitch
57
58 cd $OLDPWD
59 rm -fr tmp
60
61 # vim: sw=4 ts=4 sts=4 et :