Commit 9a4935f8 authored by Hilal Ozdemir's avatar Hilal Ozdemir

dev.sh: no need for beiran or beiran plugin installation in dev.sh. install...

dev.sh: no need for beiran or beiran plugin installation in dev.sh. install only the required libraries. add beiran plugin folders to PYTHONPATH
parents be01caed 525d33df
......@@ -4,7 +4,7 @@ DIR="$( cd "$(dirname "$0")" ; pwd -P )"
NAME=$(basename $DIR)
export VIRTUAL_ENV_DIR="${DIR}/env"
unset PYTHON_HOME
export PYTHONPATH=${DIR}:${DIR}/plugins:${DIR}/plugins/beiran_interface_k8s
export PYTHONPATH=${DIR}:${DIR}/plugins/beiran_package_docker:${DIR}/plugins/beiran_interface_k8s
export PYTHON_BINARY=python3.6
export PKG_DIR=${VIRTUAL_ENV_DIR}/lib/${PYTHON_BINARY}/site-packages
export VIRTUALENV=$(which virtualenv3 || which virtualenv || echo 'virtualenv')
......@@ -34,7 +34,8 @@ STAMP=$(date +%s)
INSTALLED=0
LAST_INSTALL=$(date -r ${VIRTUAL_ENV_DIR}/.last_install +%s 2>/dev/null || echo "0")
if [ $LAST_INSTALL -eq 0 ]; then
DEV_SH_MODIFIED=$(date -r ${DIR}/dev.sh +%s)
if [ $DEV_SH_MODIFIED -gt $LAST_INSTALL ]; then
#install prerequisite package `yajl`
apt-get install libyajl2
apt-get install libyajl-dev
......@@ -46,21 +47,23 @@ if [ $LAST_INSTALL -eq 0 ]; then
docker build -t tarsplit -f $tarsplit_dir/DockerfileTarsplit $tarsplit_dir
docker create --name tarsplit tarsplit && docker cp tarsplit:/tar-split ${tarsplit_dir}/tar-split && docker rm tarsplit && docker rmi tarsplit
fi
fi
# install beiran
${PYTHON_BINARY} setup.py install
# install beiran_package_docker
cd ${DIR}/plugins/beiran_package_docker
${PYTHON_BINARY} setup.py install
# install beiran_interface_k8s
cd ${DIR}/plugins/beiran_interface_k8s
${PYTHON_BINARY} setup.py install
cd ${DIR}
packages="beiran plugins/*"
for package in $packages; do
package_name=$(basename $package)
if [ ! -h ${PKG_DIR}/$package_name ]; then
ln -s ${DIR}/$package ${PKG_DIR}/
fi
INSTALLED=1
fi
if [ -f $package/requirements.txt ]; then
REQ_MODIFIED=$(date -r $package/requirements.txt +%s)
if [ $REQ_MODIFIED -gt $LAST_INSTALL ]; then
$PIP install -r $package/requirements.txt
INSTALLED=1
fi
fi
done
if [ $INSTALLED -eq 1 ]; then
echo $STAMP > ${VIRTUAL_ENV_DIR}/.last_install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment