cd out of install directory

This commit is contained in:
ducoterra
2019-04-16 20:25:26 -04:00
parent 2af22596a4
commit 456a336150

View File

@@ -81,6 +81,7 @@ if [ $? -ne 0 ] ; then
exit 1 exit 1
fi fi
cd ..
rm sqlite.tar.xz 1>> $pylogloc 2>> $pylogloc rm sqlite.tar.xz 1>> $pylogloc 2>> $pylogloc
rm -rf sqlite 1>> $pylogloc 2>> $pylogloc rm -rf sqlite 1>> $pylogloc 2>> $pylogloc
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
@@ -149,6 +150,7 @@ if [ $? -ne 0 ] ; then
exit 1 exit 1
fi fi
cd ..
rm python.tar.xz 1>> $pylogloc 2>> $pylogloc rm python.tar.xz 1>> $pylogloc 2>> $pylogloc
rm -rf python 1>> $pylogloc 2>> $pylogloc rm -rf python 1>> $pylogloc 2>> $pylogloc
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
@@ -159,114 +161,6 @@ fi
echo -e "\tCreating project directory" echo -e "\tCreating project directory"
mkdir /sites/ mkdir /sites/
# ################################################################################
# # Django
# # Download, setup and configure Django
# ################################################################################
# tput setaf 2
# echo -e "Starting Django project"
# tput setaf 9
# adduser $user 1> /dev/null 2> /dev/null 3> /dev/null
# if [ ! -d "/home/$user" ] ; then
# mkdir /home/$user
# chown -R $user:$user /home/$user
# fi
# mkdir /home/$user/$projectname
# if [ $? -ne 0 ] ; then
# echo -e "Failed to create $projectname directory. $djamsg"
# exit 1
# fi
# # virtual environment
# echo -e "\tCreating venv"
# cd /home/$user/$projectname
# /usr/src/python37/bin/python3.7 -m virtualenv venv 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to create virtual environment. $djamsg"
# exit 1
# fi
# source venv/bin/activate 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to source virtual environment. $djamsg"
# exit 1
# fi
# # pip installs
# pips=(django gunicorn psycopg2-binary)
# for pip in ${pips[@]};
# do
# echo -e "\tInstalling $pip"
# pip install $pip 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to install $pip. $djamsg"
# exit 1
# fi
# done
# if [ $usegit = False ] ; then
# # start django project in the project directory
# echo -e "\tStarting django project"
# django-admin startproject config . 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to start project $projectname with django-admin. $djamsg"
# exit 1
# fi
# # update allowed hosts
# echo -e "echo -e sed -i 's/ALLOWED_HOSTS = []/ALLOWED_HOSTS = ['localhost', os.environ.get('HOST')'] config/settings.py" >> $djalogloc
# # | FROM | TO |
# sed -i "s/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = \['localhost', os.environ.get('HOST')\]/" config/settings.py
# if [ $? -ne 0 ] ; then
# echo -e "Failed to change ALLOWED_HOSTS. $djamsg"
# exit 1
# fi
# echo -e "echo -e STATIC_ROOT = os.path.join(BASE_DIR, 'static') >> config//settings.py" >> $djalogloc
# echo -e "STATIC_ROOT = os.path.join(BASE_DIR, 'static')" >> config/settings.py
# if [ $? -ne 0 ] ; then
# echo -e "Failed to append STATIC_ROOT. $djamsg"
# exit 1
# fi
# fi
# if [ $usegit = True ] ; then
# echo -e "\tCloning django project"
# git init 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;
# git remote add origin $giturl 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;
# ssh-agent bash -c 'ssh-add $gitkey 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;
# git pull origin master 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;'
# echo -e "\tInstalling pip requirements"
# pip install -r requirements.txt 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc
# fi
# # collect static, migrate
# echo -e "\tCollecting static"
# python manage.py collectstatic 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to collect static files. $djamsg"
# exit 1
# fi
# echo -e "\tMaking migrations"
# python manage.py makemigrations 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to make migrations. $djamsg"
# exit 1
# fi
# echo -e "\tMigrating"
# python manage.py migrate 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
# if [ $? -ne 0 ] ; then
# echo -e "Failed to migrate. You do not survive the winter. $djamsg"
# exit 1
# fi
# deactivate
# if [ $? -ne 0 ] ; then
# echo -e "Failed to deactivate virtual environment, (this may not be an issue). $djamsg"
# fi
# chown -R $user:$user .
# if [ $? -ne 0 ] ; then
# echo -e "Failed to change permissions of $projectname. $djamsg"
# exit 1
# fi
# ################################################################################ # ################################################################################
# # Gunicorn # # Gunicorn