Adding tacker support back into Danube
[apex.git] / ci / dev_dep_check.sh
1 #!/bin/sh
2 ##############################################################################
3 # Copyright (c) 2016 Dan Radez (Red Hat) and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 # This script makes sure deploy deps are installed when not relying on RPM
12
13 set -e
14
15 rdo_action="update"
16
17 # check for rdo-release
18 if ! rpm -q rdo-release > /dev/null; then
19     rdo_action="install"
20 fi
21
22 # make sure rdo release
23 if ! sudo yum $rdo_action -y  https://www.rdoproject.org/repos/rdo-release.rpm; then
24     echo "Failed to $rdo_action RDO Release package..."
25     exit 1
26 fi
27
28 # update ipxe-roms-qemu
29 if ! sudo yum update -y ipxe-roms-qemu; then
30     echo "Failed to update ipxe-roms-qemu package..."
31     exit 1
32 fi
33
34 # check for other packages
35 for i in epel-release python34-PyYAML openvswitch openstack-tripleo libguestfs libguestfs-tools-c libvirt-python python2-oslo-config python2-debtcollector python34-devel libxslt-devel libxml2-devel; do
36 # Make sure deploy deps are installed
37     if ! rpm -q $i > /dev/null; then
38         if ! sudo yum install -y $i; then
39             echo "Failed to install $i package..."
40             exit 1
41         fi
42     fi
43 done
44
45 # install pip dependencies
46 easy_install-3.4 pip
47 sudo pip3 install python-ipmi
48
49 # Make sure jinja2 is installed
50 easy_install-3.4 jinja2
51
52 # TODO(cgoncalves): remove once congress RPM is downloaded from upstream
53 easy_install-3.4 tox
54
55 # Required packages to redirect stdin with virt-customize
56 virt_uri_base=https://people.redhat.com/~rjones/libguestfs-RHEL-7.3-preview
57 virt_pkgs=(
58 'libguestfs-1.32.7-3.el7.x86_64.rpm'
59 'libguestfs-tools-1.32.7-3.el7.noarch.rpm'
60 'libguestfs-tools-c-1.32.7-3.el7.x86_64.rpm'
61 'supermin-5.1.16-4.el7.x86_64.rpm'
62 'supermin5-5.1.16-4.el7.x86_64.rpm'
63 'supermin-helper-5.1.16-4.el7.x86_64.rpm'
64 'perl-Sys-Guestfs-1.32.7-3.el7.x86_64.rpm'
65 'python-libguestfs-1.32.7-3.el7.x86_64.rpm'
66 )
67 dir=/tmp/packages.$RANDOM
68 mkdir -p $dir
69 pushd $dir
70 all_packages=""
71 for pkg in ${virt_pkgs[@]}; do
72     if ! wget $virt_uri_base/$pkg; then
73         echo "ERROR: Failed to download $pkg"
74     fi
75     all_packages="$all_packages $pkg"
76 done
77 if [[ $all_packages != "" ]];then
78     yum install -y $all_packages
79 fi
80 rm -rf $dir
81 popd