Improve docker installation (#5115)

* ignore certain connection errors on startup
* remove invalid code that checks for the existence of the migration table
* fetch kimai code via tar archive instead of git clone, to respect .gitattributes
This commit is contained in:
Kevin Papst
2024-10-14 23:09:14 +02:00
committed by GitHub
parent 32a1306394
commit 9e736b26f6
3 changed files with 19 additions and 32 deletions

View File

@@ -93,7 +93,7 @@ final class InstallCommand extends Command
private function rebuildCaches(string $environment, SymfonyStyle $io, InputInterface $input, OutputInterface $output): int
{
$io->text('Rebuilding your cache ...');
$io->text('Rebuilding cache ...');
$command = $this->getApplication()->find('cache:clear');
try {
@@ -122,15 +122,7 @@ final class InstallCommand extends Command
private function importMigrations(SymfonyStyle $io, OutputInterface $output): void
{
try {
if (!$this->connection->createSchemaManager()->tablesExist(['migration_versions'])) {
throw new \RuntimeException('Migration table does not exist');
}
} catch (\Exception $ex) {
$io->error(['Failed to detect migration status, aborting update.', $ex->getMessage()]);
return;
}
$io->text('Creating database ...');
$command = $this->getApplication()->find('doctrine:migrations:migrate');
$cmdInput = new ArrayInput(['--allow-no-migration' => true]);
@@ -146,12 +138,11 @@ final class InstallCommand extends Command
{
try {
if ($this->connection->isConnected()) {
$io->note(\sprintf('Database is existing and connection could be established'));
// database exists: we can skip this step
return;
}
} catch (\Exception $ex) {
// this likely means that the database does not exist and the connection failed
// this means the database does not exist and the connection failed
}
$command = $this->getApplication()->find('doctrine:database:create');