From b5449129bebfda6cf8d098ae6b893a1b570f1483 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 30 Oct 2024 09:47:53 -0300 Subject: [PATCH] mysql customization --- generators/micronaut/generator.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/generators/micronaut/generator.js b/generators/micronaut/generator.js index 1d93f4ba..9586c711 100644 --- a/generators/micronaut/generator.js +++ b/generators/micronaut/generator.js @@ -204,9 +204,13 @@ export default class extends BaseApplicationGenerator { get [BaseApplicationGenerator.POST_WRITING]() { return this.asPostWritingTaskGroup({ addMysqlSleep({ application }) { - this.editFile(`${application.dockerServicesDir}mysql.yml`, content => - content.replace("'SHOW DATABASES;']", "'SHOW DATABASES;', '&&', 'sleep', '5']").replace('timeout: 5s', 'timeout: 10s') - ); + if (application.prodDatabaseTypeMysql) { + this.editFile(`${application.dockerServicesDir}mysql.yml`, content => + content + .replaceAll("['CMD', 'mysql', '-e', 'SHOW DATABASES;']", '[\'CMD-SHELL\', \'mysql -e "SHOW DATABASES;" && sleep 5\']') + .replace('timeout: 5s', 'timeout: 10s') + ); + } }, addMicronautDependencies({ application, source }) { const { javaDependencies } = application;