-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nnnLik
committed
Sep 13, 2023
1 parent
c038f5b
commit cad09aa
Showing
5 changed files
with
92 additions
and
16 deletions.
There are no files selected for viewing
Empty file.
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,69 @@ | ||
#!/bin/bash | ||
|
||
DJANGO_URL="[email protected]:5sControl/5sControll-backend-django.git" | ||
DJANGO_IMAGE_NAME="artsiom24091/django" | ||
|
||
FRONT_URL="[email protected]:5sControl/django-front.git" | ||
FRONT_IMAGE_NAME="artsiom24091/5scontrol_front" | ||
|
||
ALGORITHMS_URL="[email protected]:5sControl/algorithms.git" | ||
ALGORITHMS_IMAGE_NAME="artsiom24091/algorithms" | ||
|
||
ONVIF_URL="[email protected]:5sControl/onvif.git" | ||
ONVIF_IMAGE_NAME="artsiom24091/onvif" | ||
|
||
while true; do | ||
is_changes=0 | ||
|
||
# check django | ||
cd ../5sControll-backend-django/ | ||
git fetch | ||
if ! git diff --quiet HEAD origin/main; then | ||
git pull | ||
sudo docker build -t $DJANGO_IMAGE_NAME . | ||
cd ../server-/ | ||
sudo docker-compose down && sudo docker-compose up --detach | ||
is_changes=1 | ||
fi | ||
|
||
# check front | ||
cd ../django-front/ | ||
git fetch | ||
if ! git diff --quiet HEAD origin/development; then | ||
git pull | ||
sudo docker build -t $FRONT_IMAGE_NAME . | ||
cd ../server-/ | ||
sudo docker-compose down && sudo docker-compose up --detach | ||
is_changes=1 | ||
fi | ||
|
||
# check algorithms | ||
cd ../algorithms/ | ||
git fetch | ||
if ! git diff --quiet HEAD origin/main; then | ||
git pull | ||
sudo docker build -t $ALGORITHMS_IMAGE_NAME . | ||
cd ../server-/ | ||
is_changes=1 | ||
fi | ||
|
||
# onvif | ||
cd ../onvif/ | ||
git fetch | ||
if ! git diff --quiet HEAD origin/main; then | ||
git pull | ||
sudo docker build -t $ONVIF_IMAGE_NAME . | ||
cd ../server-/ | ||
is_changes=1 | ||
fi | ||
|
||
if [ $is_changes -eq 0 ]; then | ||
echo "No changes" | ||
else | ||
echo "Update" | ||
sudo docker-compose down && sudo docker-compose up --detach | ||
fi | ||
|
||
sleep 10 | ||
done | ||
|
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
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
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