From 3346fb05b129aa11b68b1efdc06aecbd9ba5954b Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 12 Nov 2023 16:21:20 +0100 Subject: [PATCH] refactor: rename waitfordb command --- app/Console/Commands/WaitForDb.php | 4 ++-- scripts/docker/entrypoint.sh | 10 +++++----- tests/Unit/Commands/WaitForDbTest.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/WaitForDb.php b/app/Console/Commands/WaitForDb.php index b11d43badf7..d10385231d8 100644 --- a/app/Console/Commands/WaitForDb.php +++ b/app/Console/Commands/WaitForDb.php @@ -17,14 +17,14 @@ class WaitForDb extends Command * * @var string */ - protected $signature = 'monica:waitfordb'; + protected $signature = 'waitfordb'; /** * The console command description. * * @var string */ - protected $description = 'Command description'; + protected $description = 'Wait for the database to be ready.'; /** * Execute the console command. diff --git a/scripts/docker/entrypoint.sh b/scripts/docker/entrypoint.sh index 22220206fe5..496cbc3fced 100755 --- a/scripts/docker/entrypoint.sh +++ b/scripts/docker/entrypoint.sh @@ -28,11 +28,11 @@ done if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then - MONICADIR=/var/www/html - ARTISAN="php ${MONICADIR}/artisan" + ROOT=/var/www/html + ARTISAN="php ${ROOT}/artisan" # Ensure storage directories are present - STORAGE=${MONICADIR}/storage + STORAGE=${ROOT}/storage mkdir -p ${STORAGE}/logs mkdir -p ${STORAGE}/app/public mkdir -p ${STORAGE}/framework/views @@ -59,14 +59,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then fi # Run migrations - ${ARTISAN} monica:waitfordb + ${ARTISAN} waitfordb ${ARTISAN} monica:setup --force -vv # if [ ! -f "${STORAGE}/oauth-public.key" -o ! -f "${STORAGE}/oauth-private.key" ]; then # echo "Passport keys creation ..." # ${ARTISAN} passport:keys # ${ARTISAN} passport:client --personal --no-interaction - # echo "! Please be careful to backup $MONICADIR/storage/oauth-public.key and $MONICADIR/storage/oauth-private.key files !" + # echo "! Please be careful to backup $ROOT/storage/oauth-public.key and $ROOT/storage/oauth-private.key files !" # fi fi diff --git a/tests/Unit/Commands/WaitForDbTest.php b/tests/Unit/Commands/WaitForDbTest.php index a06cde90da4..8c3cb4e9468 100644 --- a/tests/Unit/Commands/WaitForDbTest.php +++ b/tests/Unit/Commands/WaitForDbTest.php @@ -13,7 +13,7 @@ class WaitForDbTest extends TestCase #[Test] public function it_run_WaitForDb_command(): void { - $this->artisan('monica:waitfordb') + $this->artisan('waitfordb') ->expectsOutput('Database ready.') ->assertExitCode(0); }