Posted by Shiva on 23:09 in Shell | No comments
Simple shell script to clone your flask app , installing requirements, activating virtual environment and running the application.
#!/bin/ksh
CURRENT_DIR=`pwd`
echo "please enter your repo link" #input your repo link
read input_variable #Read input
echo $input_variable
REPOURL=$input_variable
#REPOURL=$input_variable
gitdir=`basename $input_variable .git`
if [[ ! -d $CURRENT_DIR/$gitdir ]]
then
git clone $REPOURL
elif [[ ! -d $CURRENT_DIR/$gitdir/.git ]]
then
mv CURRENT_DIR/$gitdir CURRENT_DIR/$gitdir"_backup"
git clone $REPOURL
fi
cd $CURRENT_DIR/$gitdir
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python app.py
0 comments:
Post a Comment