#!/bin/bash

# Navigate to your project directory
#cd /var/www/html/cx || exit

# Stash any current changes (optional, based on your workflow)
#git stash

# Pull the latest changes from the Git repository
#git pull

# Gracefully restart Gunicorn by sending HUP signal to the master process
#pkill -HUP -f 'gunicorn -w 9 -k uvicorn.workers.UvicornWorker main:app --bind 0.0.0.0:8000'

#echo "Application updated and Gunicorn gracefully restarted."

#!/bin/bash

# Navigate to your project directory

cd /var/www/html/cx


# Pull changes from Git

git pull

kill -HUP $(cat /var/www/html/gunicorn.pid)


gunicorn -w 9 -k uvicorn.workers.UvicornWorker --pid /var/www/html/gunicorn.pid main:app --bind 0.0.0.0:8000 > /var/log/gunicorn.log 2>&1 &
