Skip to content

Commit

Permalink
Merge pull request #337 from EscolaLMS/feature/wait_script
Browse files Browse the repository at this point in the history
cleanup & wait script
  • Loading branch information
qunabu authored Oct 1, 2024
2 parents 0097fbb + c9cf36d commit 8584fec
Show file tree
Hide file tree
Showing 18 changed files with 156 additions and 1,133 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ tests/coverage.txt
caddy/
!docker/conf/caddy

docker-compose.saas.yml
docker-compose.saas.yml

inited
254 changes: 127 additions & 127 deletions composer.lock

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 0 additions & 17 deletions database/seeds/cyfrowy_dobrostan/lessons.php

This file was deleted.

896 changes: 0 additions & 896 deletions database/seeds/cyfrowy_dobrostan/texts.php

This file was deleted.

60 changes: 0 additions & 60 deletions database/seeds/cyfrowy_dobrostan/topics.php

This file was deleted.

31 changes: 0 additions & 31 deletions database/seeds/cyfrowy_dobrostan/videos.php

This file was deleted.

1 change: 0 additions & 1 deletion database/seeds/cyfrowy_dobrostan/videos/.gitignore

This file was deleted.

4 changes: 4 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# disable paritcular supervisor job by deleting jobs files

rm inited

if [ -n "$MULTI_DOMAINS" ]
then
./init_multidomains.sh
Expand Down Expand Up @@ -94,6 +96,8 @@ fi

php artisan h5p:storage-link

touch inited

/usr/bin/supervisord -c /etc/supervisor/supervisord.conf


2 changes: 2 additions & 0 deletions init_multidomains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,6 @@ else
echo "Environment variable MULTI_DOMAINS is empty."
fi

touch inited

/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
3 changes: 3 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ import-postgres:
- docker compose exec postgres bash -c "psql --dbname=$(POSTGRES_DB) < /var/lib/postgresql/backups/$(BACKUP_FILE)"

init: docker-up switch-to-postgres composer-update migrate-fresh-quick

wait:
- docker compose exec --user=1000 escola_lms_app bash -c "./wait.sh"
17 changes: 17 additions & 0 deletions wait.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# After 60 seconds the loop will exit
timeout=120

while [ ! -f inited ];
do
# When the timeout is equal to zero, show an error and leave the loop.
if [ "$timeout" == 0 ]; then
echo "ERROR: Timeout while waiting for the file 'inited'"
exit 1
fi

sleep 1

# Decrease the timeout of one
((timeout--))
done

0 comments on commit 8584fec

Please sign in to comment.