38 lines
713 B
Bash
38 lines
713 B
Bash
#!/bin/sh
|
|
cd /root/app
|
|
|
|
# si no existe directorio de ambiente, se crea
|
|
if [ ! -d ./libs ]; then
|
|
python -m venv libs
|
|
. ./libs/bin/activate
|
|
pip install -r requirements.txt
|
|
fi
|
|
|
|
# activar ambiente con dependencias
|
|
. ./libs/bin/activate
|
|
|
|
if [ ! -d ./project ]; then
|
|
django-admin startproject project
|
|
fi
|
|
|
|
if [ ! -f .env ]; then
|
|
cp .env.develop .env
|
|
fi
|
|
|
|
# asignar nueva password a root
|
|
if [ "$ROOTPASS" != "" ]; then
|
|
echo "Cambiando la password de root..."
|
|
echo -n "root:$ROOTPASS" | chpasswd
|
|
unset ROOTPASS
|
|
fi
|
|
|
|
# indicar a git carpeta segura
|
|
git config --global --add safe.directory /root/app
|
|
|
|
# iniciar ssh
|
|
sh /start.sh &
|
|
|
|
# iniciar servidor
|
|
python /root/app/project/manage.py runserver 0.0.0.0:$PORT
|
|
|