From 8f6933a6aae246f9961f2637577a848b19ed1bcd Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 20 Sep 2024 18:15:55 -0300 Subject: [PATCH 1/5] configure spring boot cloud native. --- generators/spring-boot/templates/build.gradle.ejs | 10 ++++++++++ generators/spring-boot/templates/pom.xml.ejs | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/generators/spring-boot/templates/build.gradle.ejs b/generators/spring-boot/templates/build.gradle.ejs index ae1b71aa4ceb..68bd8d831a89 100644 --- a/generators/spring-boot/templates/build.gradle.ejs +++ b/generators/spring-boot/templates/build.gradle.ejs @@ -264,6 +264,16 @@ task cleanResources(type: Delete) { delete "build/resources" } +bootBuildImage { + builder = "paketobuildpacks/builder-jammy-buildpackless-tiny" + buildpacks = ["paketobuildpacks/java"] + tags = ["<%- lowercaseBaseName %>"] + environment = [ + "BPL_SPRING_AOT_ENABLED" : "true", + "BP_JVM_CDS_ENABLED" : "false", + "BP_JVM_VERSION": "<%= JAVA_VERSION %>" + ] +} <%_ if (embeddableLaunchScript) { _%> bootJar { diff --git a/generators/spring-boot/templates/pom.xml.ejs b/generators/spring-boot/templates/pom.xml.ejs index c1142e05fa00..329a07e7a3ef 100644 --- a/generators/spring-boot/templates/pom.xml.ejs +++ b/generators/spring-boot/templates/pom.xml.ejs @@ -537,6 +537,20 @@ <%_ if (cacheProviderInfinispan) { _%> -Djgroups.tcp.address=NON_LOOPBACK -Djava.net.preferIPv4Stack=true <%_ } _%> + + paketobuildpacks/builder-jammy-buildpackless-tiny + + paketobuildpacks/java + + + <%- lowercaseBaseName %> + + + true + false + ${java.version} + + From 0fa166f70be456c838c08b4dba00cb01ce3908f8 Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 20 Sep 2024 18:28:14 -0300 Subject: [PATCH 2/5] switch to Cloud Native Buildpacks --- generators/server/generator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generators/server/generator.ts b/generators/server/generator.ts index 0f62f4e8caed..9c5e4da07ec4 100644 --- a/generators/server/generator.ts +++ b/generators/server/generator.ts @@ -487,8 +487,8 @@ export default class JHipsterServerGenerator extends BaseApplicationGenerator { 'backend:start': `./mvnw${excludeWebapp}`, 'java:jar': './mvnw -ntp verify -DskipTests --batch-mode', 'java:war': './mvnw -ntp verify -DskipTests --batch-mode -Pwar', - 'java:docker': './mvnw -ntp verify -DskipTests -Pprod jib:dockerBuild', - 'java:docker:arm64': 'npm run java:docker -- -Djib-maven-plugin.architecture=arm64', + 'java:docker': './mvnw -ntp spring-boot:build-image', + 'java:docker:arm64': 'npm run java:docker', 'backend:unit:test': `./mvnw -ntp${excludeWebapp} verify --batch-mode ${javaCommonLog} ${javaTestLog}`, 'backend:build-cache': './mvnw dependency:go-offline -ntp', 'backend:debug': './mvnw -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000"', @@ -504,8 +504,8 @@ export default class JHipsterServerGenerator extends BaseApplicationGenerator { 'backend:start': `./gradlew ${excludeWebapp}`, 'java:jar': './gradlew bootJar -x test -x integrationTest', 'java:war': './gradlew bootWar -Pwar -x test -x integrationTest', - 'java:docker': './gradlew bootJar -Pprod jibDockerBuild', - 'java:docker:arm64': 'npm run java:docker -- -PjibArchitecture=arm64', + 'java:docker': './gradlew bootBuildImage', + 'java:docker:arm64': 'npm run java:docker', 'backend:unit:test': `./gradlew test integrationTest ${excludeWebapp} ${javaCommonLog} ${javaTestLog}`, 'postci:e2e:package': 'cp build/libs/*.$npm_package_config_packaging e2e.$npm_package_config_packaging', 'backend:build-cache': From 0e567aee34f093428b26d3656cd43ff9592c5e8d Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 20 Sep 2024 19:37:19 -0300 Subject: [PATCH 3/5] adjust health check --- generators/docker/templates/docker/app.yml.ejs | 4 +++- generators/spring-boot/templates/build.gradle.ejs | 6 +++++- generators/spring-boot/templates/pom.xml.ejs | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/generators/docker/templates/docker/app.yml.ejs b/generators/docker/templates/docker/app.yml.ejs index c7d90b5c61cc..5e67130687a0 100644 --- a/generators/docker/templates/docker/app.yml.ejs +++ b/generators/docker/templates/docker/app.yml.ejs @@ -95,6 +95,8 @@ _%> <%_ if (cacheProviderInfinispan) { _%> - JAVA_OPTS=-Djgroups.tcp.address=NON_LOOPBACK -Djava.net.preferIPv4Stack=true <%_ } _%> + - THC_PORT=<%= serverPort %> + - THC_PATH=/management/health <%_ if (applicationTypeMonolith || applicationTypeGateway) { _%> # If you want to expose these ports outside your dev PC, # remove the "127.0.0.1:" prefix @@ -102,7 +104,7 @@ _%> - 127.0.0.1:<%= serverPort %>:<%= serverPort %> <%_ } _%> healthcheck: - test: ['CMD', 'curl', '-f', 'http://localhost:<%= serverPort %>/management/health'] + test: ['CMD', '/workspace/health-check'] interval: 5s timeout: 5s retries: 40 diff --git a/generators/spring-boot/templates/build.gradle.ejs b/generators/spring-boot/templates/build.gradle.ejs index 68bd8d831a89..acbf5a7a1552 100644 --- a/generators/spring-boot/templates/build.gradle.ejs +++ b/generators/spring-boot/templates/build.gradle.ejs @@ -266,10 +266,14 @@ task cleanResources(type: Delete) { bootBuildImage { builder = "paketobuildpacks/builder-jammy-buildpackless-tiny" - buildpacks = ["paketobuildpacks/java"] + buildpacks = [ + "paketobuildpacks/java", + "paketobuildpacks/health-checker" + ] tags = ["<%- lowercaseBaseName %>"] environment = [ "BPL_SPRING_AOT_ENABLED" : "true", + "BP_HEALTH_CHECKER_ENABLED" : "true", "BP_JVM_CDS_ENABLED" : "false", "BP_JVM_VERSION": "<%= JAVA_VERSION %>" ] diff --git a/generators/spring-boot/templates/pom.xml.ejs b/generators/spring-boot/templates/pom.xml.ejs index 329a07e7a3ef..9f3683bffe4e 100644 --- a/generators/spring-boot/templates/pom.xml.ejs +++ b/generators/spring-boot/templates/pom.xml.ejs @@ -541,12 +541,14 @@ paketobuildpacks/builder-jammy-buildpackless-tiny paketobuildpacks/java + paketobuildpacks/health-checker <%- lowercaseBaseName %> true + true false ${java.version} From 32f2648adea6ae6a43d0d36f0e155fad010d40cc Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 20 Sep 2024 20:40:44 -0300 Subject: [PATCH 4/5] update snapshots --- .../__snapshots__/docker-compose.spec.ts.snap | 216 +++++++++--------- .../__snapshots__/generator.spec.ts.snap | 72 +++--- 2 files changed, 144 insertions(+), 144 deletions(-) diff --git a/generators/docker-compose/__snapshots__/docker-compose.spec.ts.snap b/generators/docker-compose/__snapshots__/docker-compose.spec.ts.snap index 7f14394a0e93..0712ba4eb315 100644 --- a/generators/docker-compose/__snapshots__/docker-compose.spec.ts.snap +++ b/generators/docker-compose/__snapshots__/docker-compose.spec.ts.snap @@ -102,14 +102,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -145,12 +145,12 @@ jhipster: - SPRING_COUCHBASE_CONNECTION_STRING=mscouchbase-couchbase - JHIPSTER_DATABASE_COUCHBASE_BUCKET_NAME=mscouchbase - JHIPSTER_SLEEP=20 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -293,14 +293,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -335,12 +335,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_CASSANDRA_CONTACTPOINTS=mscassandra-cassandra - JHIPSTER_SLEEP=10 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -548,14 +548,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -590,12 +590,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -631,12 +631,12 @@ jhipster: - SPRING_DATASOURCE_URL=jdbc:postgresql://mspsql-postgresql:5432/mspsql - SPRING_LIQUIBASE_URL=jdbc:postgresql://mspsql-postgresql:5432/mspsql - SPRING_ELASTICSEARCH_URIS=http://mspsql-elasticsearch:9200 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -683,12 +683,12 @@ jhipster: - SPRING_CLOUD_CONSUL_HOST=consul - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATA_MONGODB_URI=mongodb://msmongodb-mongodb:27017/msmongodb + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -720,12 +720,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mariadb://msmariadb-mariadb:3306/msmariadb?useLegacyDatetimeCode=false - SPRING_LIQUIBASE_URL=jdbc:mariadb://msmariadb-mariadb:3306/msmariadb?useLegacyDatetimeCode=false + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -930,14 +930,14 @@ jhipster: - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/realms/jhipster - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=web_app - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=web_app + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -977,12 +977,12 @@ jhipster: - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/realms/jhipster - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1023,12 +1023,12 @@ jhipster: - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal - SPRING_ELASTICSEARCH_URIS=http://mspsql-elasticsearch:9200 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1082,12 +1082,12 @@ jhipster: - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal - JHIPSTER_SLEEP=20 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1125,12 +1125,12 @@ jhipster: - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/realms/jhipster - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1360,14 +1360,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1402,12 +1402,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1443,12 +1443,12 @@ jhipster: - SPRING_DATASOURCE_URL=jdbc:postgresql://mspsql-postgresql:5432/mspsql - SPRING_LIQUIBASE_URL=jdbc:postgresql://mspsql-postgresql:5432/mspsql - SPRING_ELASTICSEARCH_URIS=http://mspsql-elasticsearch:9200 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1495,12 +1495,12 @@ jhipster: - SPRING_CLOUD_CONSUL_HOST=consul - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATA_MONGODB_URI=mongodb://msmongodb-mongodb:27017/msmongodb + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1695,14 +1695,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1737,12 +1737,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1778,12 +1778,12 @@ jhipster: - SPRING_DATASOURCE_URL=jdbc:postgresql://mspsql-postgresql:5432/mspsql - SPRING_LIQUIBASE_URL=jdbc:postgresql://mspsql-postgresql:5432/mspsql - SPRING_ELASTICSEARCH_URIS=http://mspsql-elasticsearch:9200 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1832,12 +1832,12 @@ jhipster: - SPRING_COUCHBASE_CONNECTION_STRING=mscouchbase-couchbase - JHIPSTER_DATABASE_COUCHBASE_BUCKET_NAME=mscouchbase - JHIPSTER_SLEEP=20 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1870,12 +1870,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mariadb://msmariadb-mariadb:3306/msmariadb?useLegacyDatetimeCode=false - SPRING_LIQUIBASE_URL=jdbc:mariadb://msmariadb-mariadb:3306/msmariadb?useLegacyDatetimeCode=false + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2021,14 +2021,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2063,12 +2063,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2213,14 +2213,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2255,12 +2255,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2430,14 +2430,14 @@ management: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2472,12 +2472,12 @@ management: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2711,14 +2711,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2753,12 +2753,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -2868,14 +2868,14 @@ Launch all your infrastructure by running: \`docker compose up -d\`. - SPRING_DATASOURCE_URL=jdbc:mysql://samplemysql-mysql:3306/samplemysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://samplemysql-mysql:3306/samplemysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_ELASTICSEARCH_URIS=http://samplemysql-elasticsearch:9200 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -3004,12 +3004,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -3136,14 +3136,14 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_R2DBC_URL=r2dbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://jhgate-mysql:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -3270,12 +3270,12 @@ jhipster: - SPRING_CLOUD_CONSUL_PORT=8500 - SPRING_DATASOURCE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - SPRING_LIQUIBASE_URL=jdbc:mysql://msmysql-mysql:3306/msmysql?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -3382,14 +3382,14 @@ Launch all your infrastructure by running: \`docker compose up -d\`. - MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true - SPRING_DATASOURCE_URL=jdbc:oracle:thin:@oracle-mono-oracle:1521:oracle-mono - SPRING_LIQUIBASE_URL=jdbc:oracle:thin:@oracle-mono-oracle:1521:oracle-mono + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 diff --git a/generators/docker/__snapshots__/generator.spec.ts.snap b/generators/docker/__snapshots__/generator.spec.ts.snap index c43f53737929..a7b6c95b9fc6 100644 --- a/generators/docker/__snapshots__/generator.spec.ts.snap +++ b/generators/docker/__snapshots__/generator.spec.ts.snap @@ -17,14 +17,14 @@ services: - SPRING_R2DBC_URL=r2dbc:mysql://mariadb:3306/jhipster?useLegacyDatetimeCode=false - SPRING_LIQUIBASE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false - SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -135,14 +135,14 @@ services: - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=web_app - SPRING_PULSAR_CLIENT_SERVICE_URL=pulsar://pulsar:6650 - SPRING_PULSAR_ADMINISTRATION_SERVICE_URL=http://pulsar:8080 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -243,12 +243,12 @@ services: - SPRING_DATASOURCE_URL=jdbc:oracle:thin:@oracle:1521:jhipster - SPRING_LIQUIBASE_URL=jdbc:oracle:thin:@oracle:1521:jhipster - SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka:9092 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -331,12 +331,12 @@ services: - SPRING_LIQUIBASE_URL=jdbc:postgresql://postgresql:5432/jhipster - SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200 - SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka:9092 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -455,12 +455,12 @@ services: - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/realms/jhipster - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -568,12 +568,12 @@ services: - SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200 - SPRING_PULSAR_CLIENT_SERVICE_URL=pulsar://pulsar:6650 - SPRING_PULSAR_ADMINISTRATION_SERVICE_URL=http://pulsar:8080 + - THC_PORT=8081 + - THC_PATH=/management/health healthcheck: test: - CMD - - curl - - -f - - http://localhost:8081/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -721,14 +721,14 @@ services: - SPRING_DATASOURCE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false - SPRING_LIQUIBASE_URL=jdbc:mariadb://mariadb:3306/jhipster?useLegacyDatetimeCode=false - SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka:9092 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -820,14 +820,14 @@ services: - SPRING_DATA_MONGODB_URI=mongodb://mongodb:27017/jhipster?waitQueueMultiple=1000 - SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200 - SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS=kafka:9092 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -957,14 +957,14 @@ services: - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/realms/jhipster - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=web_app - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=web_app + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1058,14 +1058,14 @@ services: - SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200 - SPRING_PULSAR_CLIENT_SERVICE_URL=pulsar://pulsar:6650 - SPRING_PULSAR_ADMINISTRATION_SERVICE_URL=http://pulsar:8080 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1198,14 +1198,14 @@ services: - JHIPSTER_CACHE_REDIS_CLUSTER=false - SPRING_PULSAR_CLIENT_SERVICE_URL=pulsar://pulsar:6650 - SPRING_PULSAR_ADMINISTRATION_SERVICE_URL=http://pulsar:8080 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 @@ -1307,14 +1307,14 @@ services: - JHIPSTER_DATABASE_COUCHBASE_BUCKET_NAME=jhipster - JHIPSTER_SLEEP=20 - SPRING_ELASTICSEARCH_URIS=http://elasticsearch:9200 + - THC_PORT=8080 + - THC_PATH=/management/health ports: - 127.0.0.1:8080:8080 healthcheck: test: - CMD - - curl - - -f - - http://localhost:8080/management/health + - /workspace/health-check interval: 5s timeout: 5s retries: 40 From 4fb7473a0b111dee3f4218b5634a280868efda2e Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 20 Sep 2024 20:41:08 -0300 Subject: [PATCH 5/5] skip tests --- generators/server/generator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/server/generator.ts b/generators/server/generator.ts index 9c5e4da07ec4..fcc1f6c70c48 100644 --- a/generators/server/generator.ts +++ b/generators/server/generator.ts @@ -487,7 +487,7 @@ export default class JHipsterServerGenerator extends BaseApplicationGenerator { 'backend:start': `./mvnw${excludeWebapp}`, 'java:jar': './mvnw -ntp verify -DskipTests --batch-mode', 'java:war': './mvnw -ntp verify -DskipTests --batch-mode -Pwar', - 'java:docker': './mvnw -ntp spring-boot:build-image', + 'java:docker': './mvnw -ntp spring-boot:build-image -DskipTests', 'java:docker:arm64': 'npm run java:docker', 'backend:unit:test': `./mvnw -ntp${excludeWebapp} verify --batch-mode ${javaCommonLog} ${javaTestLog}`, 'backend:build-cache': './mvnw dependency:go-offline -ntp',