Skip to content

Commit

Permalink
Merge pull request #182 from wultra/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
banterCZ authored Dec 20, 2023
2 parents eb4aee4 + 3a9d5ee commit b99bd1d
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 17 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion deploy/conf/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy/dockerfile/database/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

Expand Down
1 change: 0 additions & 1 deletion deploy/env.list.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -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=
1 change: 0 additions & 1 deletion docs/Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
```
Expand Down
99 changes: 90 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.3</version>
<version>3.1.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.wultra.app</groupId>
<artifactId>mobile-utility-server</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
<packaging>war</packaging>
<name>Mobile Utility Server</name>
<description>Utility server with various features suitable for mobile apps</description>
Expand Down Expand Up @@ -60,15 +60,34 @@
<!-- Project Properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Wultra dependencies -->
<powerauth-crypto.version>1.6.0</powerauth-crypto.version>
<wultra-core.version>1.8.0</wultra-core.version>

<!-- Dependency Versions -->
<bc.version>1.76</bc.version>
<powerauth-crypto.version>1.5.1</powerauth-crypto.version>
<wultra-core.version>1.7.0</wultra-core.version>
<springdoc-openapi-starter-webmvc-ui.version>2.2.0</springdoc-openapi-starter-webmvc-ui.version>
<gatling-charts-highcharts.version>3.9.2</gatling-charts-highcharts.version>
<bc.version>1.77</bc.version>
<springdoc-openapi-starter-webmvc-ui.version>2.3.0</springdoc-openapi-starter-webmvc-ui.version>
<gatling-charts-highcharts.version>3.10.0</gatling-charts-highcharts.version>
<logstash.version>7.4</logstash.version>
<!-- TODO (racansky, 2023-12-08) temporarily override the version 1.4.11 from spring boot version because of CVE -->
<logback.version>1.4.14</logback.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Spring Dependencies -->
<dependency>
Expand Down Expand Up @@ -135,7 +154,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.9.5</version>
<version>3.9.6</version>
</dependency>

<!-- Logging -->
Expand Down Expand Up @@ -204,7 +223,7 @@
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>4.3.0</version>
<version>4.7.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -219,6 +238,7 @@
<rules>
<bannedDependencies>
<excludes>
<exclude>org.apache.tomcat.embed:*:*:*:compile</exclude>
<exclude>org.bouncycastle:bcpkix-jdk15on:*:*:compile</exclude>
<exclude>org.bouncycastle:bcprov-jdk15on:*:*:compile</exclude>
<!-- Force switching to Jakarta EE -->
Expand Down Expand Up @@ -305,6 +325,67 @@
</plugins>
</build>
</profile>
<profile>
<id>internal-repository</id>
<activation>
<property>
<name>useInternalRepo</name>
<value>true</value>
</property>
</activation>
<properties>
</properties>
<distributionManagement>
<repository>
<id>jfrog-central</id>
<name>Wultra Artifactory-releases</name>
<url>https://wultra.jfrog.io/artifactory/internal-maven-repository</url>
</repository>
<snapshotRepository>
<id>jfrog-central</id>
<name>Wultra Artifactory-snapshots</name>
<url>https://wultra.jfrog.io/artifactory/internal-maven-repository</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>jfrog-central</id>
<name>Wultra Artifactory-releases</name>
<url>https://wultra.jfrog.io/artifactory/internal-maven-repository</url>
</repository>
<repository>
<id>ossrh-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>public-repository</id>
<activation>
<property>
<name>!useInternalRepo</name>
</property>
</activation>
<properties>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<repositories>
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ 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

# 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

Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/application-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b99bd1d

Please sign in to comment.