Skip to content

Commit

Permalink
refactor: rename waitfordb command (#7015)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Nov 13, 2023
1 parent 43ce1d2 commit 6d612db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/WaitForDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions scripts/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Commands/WaitForDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6d612db

Please sign in to comment.