-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add update script * add crontab exemple
- Loading branch information
1 parent
c826e7d
commit 07d05b0
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# This script performs: | ||
# pull origin master | ||
#- if any change: | ||
# kill container | ||
# rebuild docker compose | ||
# | ||
# This script must be run with a crontab | ||
# */10 * * * * bash /home/pi/pyro-engine/pyroengine/pi_utils/update_script.sh | ||
|
||
|
||
CID=$(docker ps | grep server_web | awk '{print $1}') | ||
|
||
if [ `git -C /home/pi/pyro-engine pull origin master | grep -c "up to date."` -ne 1 ]; | ||
then | ||
echo "pyro-engine updated from github"; | ||
cd /home/pi/pyro-engine/server/; | ||
docker kill CID; | ||
echo "rebuild docker"; | ||
PORT=8002 docker-compose up -d --build; | ||
else | ||
echo "pyro-engine up to date"; | ||
fi; |