Skip to content

Commit

Permalink
mysql customization
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Oct 30, 2024
1 parent 35c2fc4 commit b544912
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions generators/micronaut/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b544912

Please sign in to comment.