Initial commit

This commit is contained in:
2024-07-13 00:53:45 +03:00
commit 00eabc8150
25 changed files with 870 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# echo "export PROJECT_NAME=value" >> ~/.bashrc
# Check if project_name arugment is provided
# if [ $# -ne 1 ]; then
# echo "Usage: $0 <project_name>"
# exit 1
# fi
# project_name=$1
if [ -z "$PROJECT_NAME" ]; then
echo "Error: PROJECT_NAME is not set."
exit 1
fi
# Change to your desired directory
cd /var/www/$PROJECT_NAME
# Perform a git pull
git pull
git submodule init
git submodule update
# Activate virtual environment
source /var/www/venvs/$PROJECT_NAME/bin/activate
# Collect static files
python manage.py collectstatic --noinput
# Create database migrations
python manage.py makemigrations
# Apply database migrations
python manage.py migrate
# Restart supervisor processes
sudo supervisorctl restart $PROJECT_NAME
sudo supervisorctl restart "$PROJECT_NAME"_celery