Add common log and configuration places,add EL6 support
Change-Id: I3cfb3505fcc840669d2f9a51bbd8b8cc90c9d5ca
This commit is contained in:
43
setup.sh
43
setup.sh
@@ -20,7 +20,9 @@ SERVICE_CONTENT_DIRECTORY=`cd $(dirname "$0") && pwd`
|
|||||||
PREREQ_PKGS="wget make git python-pip python-dev python-mysqldb libxml2-dev libxslt-dev libffi-dev"
|
PREREQ_PKGS="wget make git python-pip python-dev python-mysqldb libxml2-dev libxslt-dev libffi-dev"
|
||||||
SERVICE_SRV_NAME="murano-repository"
|
SERVICE_SRV_NAME="murano-repository"
|
||||||
GIT_CLONE_DIR=`echo $SERVICE_CONTENT_DIRECTORY | sed -e "s/$SERVICE_SRV_NAME//"`
|
GIT_CLONE_DIR=`echo $SERVICE_CONTENT_DIRECTORY | sed -e "s/$SERVICE_SRV_NAME//"`
|
||||||
ETC_CFG_DIR="/etc/$SERVICE_SRV_NAME"
|
#ETC_CFG_DIR="/etc/$SERVICE_SRV_NAME"
|
||||||
|
ETC_CFG_DIR="/etc/murano"
|
||||||
|
LOG_DIR="/var/log/murano/"
|
||||||
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/murano-repository.conf"
|
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/murano-repository.conf"
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
@@ -58,8 +60,8 @@ gitclone()
|
|||||||
log "Cloning from \"$FROM\" repo to \"$CLONEROOT\""
|
log "Cloning from \"$FROM\" repo to \"$CLONEROOT\""
|
||||||
cd $CLONEROOT && git clone $FROM > /dev/null 2>&1
|
cd $CLONEROOT && git clone $FROM > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
log "cloning from \"$FROM\" fails, exiting!!!"
|
log "cloning from \"$FROM\" fails, exiting!!!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,25 +94,18 @@ CLONE_FROM_GIT=$1
|
|||||||
|
|
||||||
# Setupping...
|
# Setupping...
|
||||||
log "Running setup.py"
|
log "Running setup.py"
|
||||||
#MRN_CND_SPY=$GIT_CLONE_DIR/$SERVICE_SRV_NAME/setup.py
|
|
||||||
MRN_CND_SPY=$SERVICE_CONTENT_DIRECTORY/setup.py
|
MRN_CND_SPY=$SERVICE_CONTENT_DIRECTORY/setup.py
|
||||||
if [ -e $MRN_CND_SPY ]; then
|
if [ -e $MRN_CND_SPY ]; then
|
||||||
chmod +x $MRN_CND_SPY
|
chmod +x $MRN_CND_SPY
|
||||||
log "$MRN_CND_SPY output:_____________________________________________________________"
|
log "$MRN_CND_SPY output:_____________________________________________________________"
|
||||||
#cd $GIT_CLONE_DIR/$SERVICE_SRV_NAME && $MRN_CND_SPY install
|
|
||||||
#if [ $? -ne 0 ]; then
|
|
||||||
# log "\"$MRN_CND_SPY\" python setup FAILS, exiting!"
|
|
||||||
# exit 1
|
|
||||||
#fi
|
|
||||||
## Setup through pip
|
## Setup through pip
|
||||||
# Creating tarball
|
# Creating tarball
|
||||||
#cd $GIT_CLONE_DIR/$SERVICE_SRV_NAME && $MRN_CND_SPY sdist
|
rm -rf $SERVICE_CONTENT_DIRECTORY/*.egg-info
|
||||||
rm -rf $SERVICE_CONTENT_DIRECTORY/*.egg-info
|
|
||||||
cd $SERVICE_CONTENT_DIRECTORY && python $MRN_CND_SPY egg_info
|
cd $SERVICE_CONTENT_DIRECTORY && python $MRN_CND_SPY egg_info
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
log "\"$MRN_CND_SPY\" egg info creation FAILS, exiting!!!"
|
log "\"$MRN_CND_SPY\" egg info creation FAILS, exiting!!!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -rf $SERVICE_CONTENT_DIRECTORY/dist/*
|
rm -rf $SERVICE_CONTENT_DIRECTORY/dist/*
|
||||||
cd $SERVICE_CONTENT_DIRECTORY && $MRN_CND_SPY sdist
|
cd $SERVICE_CONTENT_DIRECTORY && $MRN_CND_SPY sdist
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
@@ -118,8 +113,6 @@ CLONE_FROM_GIT=$1
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Running tarball install
|
# Running tarball install
|
||||||
#TRBL_FILE=$(basename `ls $GIT_CLONE_DIR/$SERVICE_SRV_NAME/dist/*.tar.gz`)
|
|
||||||
#pip install $GIT_CLONE_DIR/$SERVICE_SRV_NAME/dist/$TRBL_FILE
|
|
||||||
TRBL_FILE=$(basename `ls $SERVICE_CONTENT_DIRECTORY/dist/*.tar.gz`)
|
TRBL_FILE=$(basename `ls $SERVICE_CONTENT_DIRECTORY/dist/*.tar.gz`)
|
||||||
pip install $SERVICE_CONTENT_DIRECTORY/dist/$TRBL_FILE
|
pip install $SERVICE_CONTENT_DIRECTORY/dist/$TRBL_FILE
|
||||||
if [ $? -ne 0 ];then
|
if [ $? -ne 0 ];then
|
||||||
@@ -138,11 +131,21 @@ CLONE_FROM_GIT=$1
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
# Creating log directory for the murano
|
||||||
|
if [ ! -d $LOG_DIR ];then
|
||||||
|
log "Creating $LOG_DIR direcory..."
|
||||||
|
mkdir -p $LOG_DIR
|
||||||
|
if [ $? -ne 0 ];then
|
||||||
|
log "Can't create $LOG_DIR, exiting!!!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
chmod -R a+rw $LOG_DIR
|
||||||
|
fi
|
||||||
# making sample configs
|
# making sample configs
|
||||||
log "Making sample configuration files at \"$ETC_CFG_DIR\""
|
log "Making sample configuration files at \"$ETC_CFG_DIR\""
|
||||||
for file in `ls $SERVICE_CONTENT_DIRECTORY/etc`
|
for file in `ls $SERVICE_CONTENT_DIRECTORY/etc`
|
||||||
do
|
do
|
||||||
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/$file"
|
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/$file"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,8 +180,8 @@ start on runlevel [2345]
|
|||||||
stop on runlevel [!2345]
|
stop on runlevel [!2345]
|
||||||
respawn
|
respawn
|
||||||
exec start-stop-daemon --start --chuid root --user root --name $SERVICE_SRV_NAME --exec $SERVICE_EXEC_PATH -- --config-file=$SERVICE_CONFIG_FILE_PATH" > "/etc/init/$SERVICE_SRV_NAME.conf"
|
exec start-stop-daemon --start --chuid root --user root --name $SERVICE_SRV_NAME --exec $SERVICE_EXEC_PATH -- --config-file=$SERVICE_CONFIG_FILE_PATH" > "/etc/init/$SERVICE_SRV_NAME.conf"
|
||||||
log "Reloading initctl"
|
log "Reloading initctl"
|
||||||
initctl reload-configuration
|
initctl reload-configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
# purge init
|
# purge init
|
||||||
|
Reference in New Issue
Block a user