Compare commits
5 Commits
ubuntu
...
centos-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4dfdaeac7 | ||
|
|
ac8b6d8941 | ||
|
|
f7b8d6da96 | ||
|
|
2258b1df0e | ||
|
|
7a2ec49b6d |
23
install.sh
23
install.sh
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
################################################################################s
|
################################################################################s
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# Installs Dependencies automatically
|
# Installs Dependencies automatically
|
||||||
@@ -181,14 +183,6 @@ if [ $usegit = False ] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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 "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
|
echo -e "STATIC_ROOT = os.path.join(BASE_DIR, 'static')" >> config/settings.py
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
@@ -199,17 +193,26 @@ fi
|
|||||||
|
|
||||||
if [ $usegit = True ] ; then
|
if [ $usegit = True ] ; then
|
||||||
echo -e "\tCloning django project"
|
echo -e "\tCloning django project"
|
||||||
ssh-agent bash -c 'ssh-add $gitkey 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;
|
|
||||||
git init 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;
|
git init 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;
|
||||||
git remote add origin $giturl 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;'
|
git pull origin master 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc;'
|
||||||
echo -e "\tInstalling pip requirements"
|
echo -e "\tInstalling pip requirements"
|
||||||
pip install -r requirements.txt 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc
|
pip install -r requirements.txt 1>> $gitlogloc 2>> $gitlogloc 3>> $gitlogloc
|
||||||
fi
|
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
|
||||||
|
|
||||||
# collect static, migrate
|
# collect static, migrate
|
||||||
echo -e "\tCollecting static"
|
echo -e "\tCollecting static"
|
||||||
python manage.py collectstatic 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
|
python manage.py collectstatic --noinput 1>> $djalogloc 2>> $djalogloc 3>> $djalogloc
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
echo -e "Failed to collect static files. $djamsg"
|
echo -e "Failed to collect static files. $djamsg"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
2
reset.sh
2
reset.sh
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Performs a QUICK uninstall #
|
# Performs a QUICK uninstall #
|
||||||
# - Does not uninstall dependencies #
|
# - Does not uninstall dependencies #
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Performs a FULL uninstall #
|
# Performs a FULL uninstall #
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
14
vars
14
vars
@@ -1,11 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# django project settings
|
# django project settings
|
||||||
export user=""
|
export user=""
|
||||||
export projectname=""
|
export projectname=""
|
||||||
export hostname=""
|
export hostname=""
|
||||||
export usegit=False # if you have a django git project
|
|
||||||
export giturl="" # url for git project
|
# MAKE SURE root HAS A DEPLOY KEY
|
||||||
export gitkey="" # IdentityFile
|
export usegit=False
|
||||||
install_epel_release=False
|
export giturl=""
|
||||||
|
export gitbranch=""
|
||||||
|
export gitkey=""
|
||||||
|
|
||||||
|
export install_epel_release=False
|
||||||
|
|
||||||
# general install settings
|
# general install settings
|
||||||
export logdir="/var/log/djangosetup/"
|
export logdir="/var/log/djangosetup/"
|
||||||
|
|||||||
Reference in New Issue
Block a user