Skip to content

Commit

Permalink
adding commands to kill previous processes
Browse files Browse the repository at this point in the history
  • Loading branch information
varsha1305nav committed Apr 4, 2024
1 parent 4db273e commit 23a557a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/deploy_prod_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
host: ${{ secrets.PRODSERVER_API }}
username: ${{ secrets.USERNAME_PROD }}
key: ${{ secrets.SECRETKEY_PROD }}
command_timeout: 10m
command_timeout: 5m
script: |
cd xfluencer/influencer-marketplace
pwd
Expand All @@ -41,6 +41,27 @@ jobs:
pip3 install -r requirements.txt
python3 manage.py migrate
python3 manage.py collectstatic -link --noinput
echo "Stopping previous processes..."
# Get the PID of the processes
celery_pid=$(pgrep -f "celery worker")
beat_pid=$(pgrep -f "beat")
marketplace_pid=$(pgrep -f "marketplace")
# Check if the PID is non-empty and kill the processes
if [ -n "$celery_pid" ]; then
kill $celery_pid
echo "Celery worker process with PID $celery_pid killed."
fi
if [ -n "$beat_pid" ]; then
kill $beat_pid
echo "Beat process with PID $beat_pid killed."
fi
if [ -n "$marketplace_pid" ]; then
kill $marketplace_pid
echo "Marketplace process with PID $marketplace_pid killed."
fi
echo "Stopping redis service..."
sudo systemctl stop redis
echo "Starting redis service..."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_prod_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
host: ${{ secrets.PRODSERVER_UI }}
username: ${{ secrets.USERNAME_PROD }}
key: ${{ secrets.SECRETKEY_PROD }}
command_timeout: 10m
command_timeout: 5m
script: |
cd xfluencer/influencer-marketplace
git pull
Expand Down

0 comments on commit 23a557a

Please sign in to comment.