Skip to content

Commit

Permalink
Update errors
Browse files Browse the repository at this point in the history
  • Loading branch information
munisisazade committed Aug 2, 2017
1 parent 700e762 commit 6b9d7ab
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
18 changes: 17 additions & 1 deletion commands/base
Expand Up @@ -8,7 +8,7 @@ sudo su - $APP_USER_LINUX << \EOF
CONF_ROOT=/var/local
source $CONF_ROOT/config.txt
source $CONF_ROOT/status.txt
sudo !
if [ $REPO_CLONE ]; then
echo "Repository check ...."
sleep 3
Expand Down Expand Up @@ -45,7 +45,23 @@ sudo su - $APP_USER_LINUX << \EOF
echo -e "| +-- tests.py"
echo -e "|-- ${bold}manage.py${normal}"
echo -e "|-- ${bold}requirements.txt${normal}\e[0m"
sudo touch $CONF_ROOT/error.log
sudo echo "ERROR : manage.py file doest exist the system" >> $CONF_ROOT/error.log
exit 123
else
sudo rm -rf $CONF_ROOT/error.log
fi
if [ ! -f "requirements.txt" ]; then
echo -e "\e[31mERROR : requirements.txt file doest exist the system\e[0m"
echo -e "\e[34mPlease make sure your django application have requirements.txt if not:"
echo -e "Add application requirements files your project"
echo -e "pip install gunicorn"
echo -e "pip freeze > ${bold}requirements.txt${normal}"
sudo touch $CONF_ROOT/error.log
sudo echo "ERROR : requirements.txt file doest exist the system" >> $CONF_ROOT/error.log
exit 123
else
sudo rm -rf $CONF_ROOT/error.log
fi
echo -e "Create Virtualenviroment"
python3 -m venv .venv
Expand Down
23 changes: 14 additions & 9 deletions deploy.sh
Expand Up @@ -399,15 +399,20 @@ EOF

function done_script() {
. $CONF_ROOT/config.txt

echo "Everything is OK :)"
echo "---"
echo "---"
echo "Deployment ready! Now log into linux user, intialize the virtual environment, \
start the server and you'll be able to see the django-app!"
echo "---"
echo "---"
sudo su - $APP_USER
if [ ! -f "/var/local/error.log" ]; then
echo "Everything is OK :)"
echo "---"
echo "---"
echo "Deployment ready! Now log into linux user, intialize the virtual environment, \
start the server and you'll be able to see the django-app!"
echo "---"
echo "---"
sudo su - $APP_USER
else
echo "You have a error :("
echo "Deployment unsuccessfull , \
If you want to show error log write cat /var/local/error.log"
fi

}

Expand Down

0 comments on commit 6b9d7ab

Please sign in to comment.