Add scripts which install a dependency package

These install packages depended on a scenario test tool.

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
fumihiko kakuma 2016-10-28 09:10:19 +09:00 committed by FUJITA Tomonori
parent cd068e53ea
commit 76061634a0
3 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,43 @@
#!/bin/bash
set -ex
RYU_PATH=`dirname $0`
source ${RYU_PATH}/install_docker_test_pkg_common.sh
function add_docker_aptline {
sudo apt-get update
if ! apt-cache search docker-engine | grep docker-engine; then
VER=`lsb_release -r`
if echo $VER | grep 12.04; then
REL_NAME=precise
elif echo $VER | grep 14.04; then
REL_NAME=trusty
elif echo $VER | grep 15.10; then
REL_NAME=wily
elif echo $VER | grep 16.04; then
REL_NAME=xenial
else
retrun 1
fi
RELEASE=ubuntu-$REL_NAME
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo sh -c "echo deb https://apt.dockerproject.org/repo $RELEASE main > /etc/apt/sources.list.d/docker.list"
fi
}
init_variables
process_options "$@"
if [ $APTLINE_DOCKER -eq 1 ]; then
add_docker_aptline
fi
sudo apt-get update
if apt-cache search docker-engine | grep docker-engine; then
DOCKER_PKG=docker-engine
else
DOCKER_PKG=docker.io
fi
sudo apt-get install -y $DOCKER_PKG
install_depends_pkg

View File

@ -0,0 +1,37 @@
#!/bin/bash
set -ex
function init_variables {
APTLINE_DOCKER=0
DIR_BASE=/tmp
SUDO_PIP=""
}
function process_options {
local max
local i
max=$#
i=1
while [ $i -le $max ]; do
case "$1" in
-a|--add-docker-aptline)
APTLINE_DOCKER=1
;;
-d|--download-dir)
shift; ((i++))
DIR_BASE=$1
;;
-s|--sudo-pip)
SUDO_PIP=sudo
;;
esac
shift; ((i++))
done
}
function install_depends_pkg {
sudo rm -rf $DIR_BASE/pipework
git clone https://github.com/jpetazzo/pipework.git $DIR_BASE/pipework
sudo install -m 0755 $DIR_BASE/pipework/pipework /usr/local/bin/pipework
$SUDO_PIP pip install docker-py pycrypto nsenter
}

View File

@ -0,0 +1,13 @@
#!/bin/bash
set -ex
RYU_PATH=`dirname $0`
source ${RYU_PATH}/install_docker_test_pkg_common.sh
init_variables
process_options "$@"
SUDO_PIP=""
sudo apt-get update
install_depends_pkg