Created
January 28, 2023 16:05
-
-
Save cyrillsemenov/2b08603f253e2861b0ee8d80967326f1 to your computer and use it in GitHub Desktop.
.git/hooks/post-merge for stop and rerun application on push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd ~/<work_dir_here> | |
script=main.py | |
pid=$(ps auxwww | grep $script | grep -v grep | awk '{print $2}') | |
kill -9 $pid | |
pip install -r requirements.txt | |
nohup python -u $script > script.log 2>&1 & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment