diff --git a/.github/workflows/maven-deploy.yml b/.github/workflows/maven-deploy.yml new file mode 100644 index 00000000..1d4146ba --- /dev/null +++ b/.github/workflows/maven-deploy.yml @@ -0,0 +1,50 @@ +name: Deploy with Maven + +on: + workflow_dispatch: + branches: + - 'develop' + - 'master' + - 'releases/*' + inputs: + release_type: + type: choice + description: releasing to snapshot or release + default: snapshot + options: + - snapshot + - release + environment: + type: environment + default: internal-publish + description: internal or external repository + push: + branches: + - 'develop' + + + +jobs: + maven-deploy-push: + if: ${{ github.event_name == 'push' }} + name: Deploy to jfrog + uses: wultra/wultra-infrastructure/.github/workflows/maven-deploy.yml@develop + with: + environment: internal-publish + release_type: snapshot + secrets: + username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + + maven-deploy-manual: + if: ${{ github.event_name == 'workflow_dispatch' }} + name: Deploy by parameter + uses: wultra/wultra-infrastructure/.github/workflows/maven-deploy.yml@develop + with: + environment: ${{ inputs.environment }} + release_type: ${{ inputs.release_type }} + secrets: + username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + gpg_passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + gpg_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} \ No newline at end of file diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index 3303e80b..a47c0bfd 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -39,7 +39,7 @@ jobs: echo "REVISION=$REVISION" >> $GITHUB_ENV - name: Prepare wars and libs run: | - mvn clean package + mvn -U -DuseInternalRepo=true --no-transfer-progress clean package - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx diff --git a/deploy/conf/application.properties b/deploy/conf/application.properties index 4098a71b..a6de95d9 100644 --- a/deploy/conf/application.properties +++ b/deploy/conf/application.properties @@ -27,7 +27,6 @@ spring.datasource.driverClassName=${MOBILE_UTILITY_SERVER_DATASOURCE_DRIVER:org. spring.jpa.properties.hibernate.connection.CharSet=${MOBILE_UTILITY_SERVER_JPA_CHARSET:} spring.jpa.properties.hibernate.connection.characterEncoding=${MOBILE_UTILITY_SERVER_JPA_CHARACTER_ENCODING:utf8} spring.jpa.properties.hibernate.connection.useUnicode=${MOBILE_UTILITY_SERVER_JPA_USE_UNICODE:true} -spring.jpa.database-platform=${MOBILE_UTILITY_SERVER_JPA_DATABASE_PLATFORM:org.hibernate.dialect.PostgreSQLDialect} spring.datasource.jndi-name=${MOBILE_UTILITY_SERVER_DATASOURCE_JNDI_NAME:false} # Hibernate Configuration diff --git a/deploy/dockerfile/database/Dockerfile b/deploy/dockerfile/database/Dockerfile index d1adebb6..e5d40634 100644 --- a/deploy/dockerfile/database/Dockerfile +++ b/deploy/dockerfile/database/Dockerfile @@ -1,5 +1,5 @@ # Docker Image for Runtime -FROM ibm-semeru-runtimes:open-17.0.8_7-jre +FROM ibm-semeru-runtimes:open-17.0.9_9-jre LABEL maintainer="Petr Dvořák " diff --git a/deploy/env.list.tmp b/deploy/env.list.tmp index fc1fe636..4b2884d3 100644 --- a/deploy/env.list.tmp +++ b/deploy/env.list.tmp @@ -6,6 +6,5 @@ MOBILE_UTILITY_SERVER_JPA_DDL_AUTO=none MOBILE_UTILITY_SERVER_JPA_CHARSET= MOBILE_UTILITY_SERVER_JPA_CHARACTER_ENCODING=utf8 MOBILE_UTILITY_SERVER_JPA_USE_UNICODE=true -MOBILE_UTILITY_SERVER_JPA_DATABASE_PLATFORM=org.hibernate.dialect.PostgreSQLDialect MOBILE_UTILITY_SERVER_DATASOURCE_JNDI_NAME=false MOBILE_UTILITY_SERVER_LOGGING= diff --git a/docs/Deployment.md b/docs/Deployment.md index 5c358374..b17b3bad 100644 --- a/docs/Deployment.md +++ b/docs/Deployment.md @@ -25,7 +25,6 @@ spring.datasource.driverClassName=${MOBILE_UTILITY_SERVER_DATASOURCE_DRIVER:org. spring.jpa.properties.hibernate.connection.CharSet=${MOBILE_UTILITY_SERVER_JPA_CHARSET:} spring.jpa.properties.hibernate.connection.characterEncoding=${MOBILE_UTILITY_SERVER_JPA_CHARACTER_ENCODING:utf8} spring.jpa.properties.hibernate.connection.useUnicode=${MOBILE_UTILITY_SERVER_JPA_USE_UNICODE:true} -spring.jpa.database-platform=${MOBILE_UTILITY_SERVER_JPA_DATABASE_PLATFORM:org.hibernate.dialect.PostgreSQLDialect} spring.datasource.jndi-name=${MOBILE_UTILITY_SERVER_DATASOURCE_JNDI_NAME:false} spring.jpa.hibernate.ddl-auto=${MOBILE_UTILITY_SERVER_JPA_DDL_AUTO:none} ``` diff --git a/pom.xml b/pom.xml index 3ec4ecf3..dc38ea2e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,13 +6,13 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.1.6 com.wultra.app mobile-utility-server - 1.5.0 + 1.6.0 war Mobile Utility Server Utility server with various features suitable for mobile apps @@ -60,15 +60,34 @@ UTF-8 + + 1.6.0 + 1.8.0 + - 1.76 - 1.5.1 - 1.7.0 - 2.2.0 - 3.9.2 + 1.77 + 2.3.0 + 3.10.0 7.4 + + 1.4.14 + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + org.apache.tomcat.embed + tomcat-embed-el + provided + + + + @@ -135,7 +154,7 @@ org.apache.maven maven-artifact - 3.9.5 + 3.9.6 @@ -204,7 +223,7 @@ io.gatling gatling-maven-plugin - 4.3.0 + 4.7.0 org.apache.maven.plugins @@ -219,6 +238,7 @@ + org.apache.tomcat.embed:*:*:*:compile org.bouncycastle:bcpkix-jdk15on:*:*:compile org.bouncycastle:bcprov-jdk15on:*:*:compile @@ -305,6 +325,67 @@ + + internal-repository + + + useInternalRepo + true + + + + + + + jfrog-central + Wultra Artifactory-releases + https://wultra.jfrog.io/artifactory/internal-maven-repository + + + jfrog-central + Wultra Artifactory-snapshots + https://wultra.jfrog.io/artifactory/internal-maven-repository + + + + + jfrog-central + Wultra Artifactory-releases + https://wultra.jfrog.io/artifactory/internal-maven-repository + + + ossrh-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + false + + + true + + + + + + public-repository + + + !useInternalRepo + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 2c5a8c99..85143950 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -27,7 +27,6 @@ spring.datasource.driverClassName=org.postgresql.Driver spring.datasource.hikari.auto-commit=false spring.jpa.properties.hibernate.connection.characterEncoding=utf8 spring.jpa.properties.hibernate.connection.useUnicode=true -spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect # Hibernate Configuration spring.jpa.hibernate.ddl-auto=none @@ -35,6 +34,10 @@ spring.jpa.hibernate.ddl-auto=none # Set JMX default domain in case JMX is enabled, otherwise the application startup fails due to clash in JMX bean names spring.jmx.default-domain=mobile-utility-server +spring.application.name=mobile-utility-server +banner.application.name=${spring.application.name} +banner.application.version=@project.version@ + # Disable open session in view to avoid startup warning of Spring boot spring.jpa.open-in-view=false diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt new file mode 100644 index 00000000..fb458110 --- /dev/null +++ b/src/main/resources/banner.txt @@ -0,0 +1,10 @@ + __ __ _ _ _ _ _ _ _ _ _ _ ____ + | \/ | ___ | |__ (_) | ___ | | | | |_(_) (_) |_ _ _ / ___| ___ _ ____ _____ _ __ + | |\/| |/ _ \| '_ \| | |/ _ \ | | | | __| | | | __| | | | \___ \ / _ \ '__\ \ / / _ \ '__| + | | | | (_) | |_) | | | __/ | |_| | |_| | | | |_| |_| | ___) | __/ | \ V / __/ | + |_| |_|\___/|_.__/|_|_|\___| \___/ \__|_|_|_|\__|\__, | |____/ \___|_| \_/ \___|_| + |___/ + +${AnsiColor.GREEN} :: ${banner.application.name} (${banner.application.version}) :: ${AnsiColor.GREEN} +${AnsiColor.RED} :: Spring Boot${spring-boot.formatted-version} :: ${AnsiColor.RED} +${AnsiColor.DEFAULT} \ No newline at end of file diff --git a/src/test/java/com/wultra/app/mobileutilityserver/MobileUtilityServerApplicationTests.java b/src/test/java/com/wultra/app/mobileutilityserver/MobileUtilityServerApplicationTests.java index d2a80483..f56e92ee 100644 --- a/src/test/java/com/wultra/app/mobileutilityserver/MobileUtilityServerApplicationTests.java +++ b/src/test/java/com/wultra/app/mobileutilityserver/MobileUtilityServerApplicationTests.java @@ -2,8 +2,10 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; -@SpringBootTest +@SpringBootTest(classes = MobileUtilityServerApplicationTests.class) +@ActiveProfiles("test") class MobileUtilityServerApplicationTests { @Test diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index e4ae59d8..a5b27aa8 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -2,7 +2,6 @@ spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE spring.datasource.username=sa spring.datasource.password=password spring.datasource.driver-class-name=org.h2.Driver -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect spring.jpa.hibernate.ddl-auto=create spring.liquibase.enabled=false