Files
puppet-openstack_spec_helper/functions
Emilien Macchi 3b95864daa Create functions from run_unit_tests.sh
Take some bits from run_unit_tests.sh and put them in functions, so
we'll be able to re-use it from different scripts later.

Change-Id: I3d4dc96549a178a352a24b8367dc56ce90e1a6ee
2016-01-25 14:53:20 -05:00

27 lines
839 B
Bash

#!/bin/bash
#
# functions - puppet-openstack_spec_helper specific functions
#
install_gems() {
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
# use puppet-nova to test the gem
if [ -e /usr/zuul-env/bin/zuul-cloner ] ; then
/usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
git://git.openstack.org openstack/puppet-nova
else
git clone git://git.openstack.org/openstack/puppet-nova openstack/puppet-nova
fi
cd openstack/puppet-nova
# Modify Gemfile to use local library and not the one on git
# so we can actually test the current state of the gem.
sed -i "s/.*git => 'https:\/\/git.openstack.org\/openstack\/puppet-openstack_spec_helper.*/ :path => '..\/..',/" Gemfile
# Install dependencies
gem install bundler --no-rdoc --no-ri --verbose
$GEM_HOME/bin/bundle install
}