Skip to content

Commit

Permalink
Merge pull request #157 from com-pas/develop
Browse files Browse the repository at this point in the history
New release with small fixes
  • Loading branch information
Dennis Labordus authored Dec 9, 2021
2 parents 2524dd3 + a42929d commit 5c43142
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 102 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
push:
branches:
- '**'
- '!main'
- '!develop'
pull_request:
branches:
- 'main'
Expand Down Expand Up @@ -40,7 +38,7 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 1.11
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '11'
Expand All @@ -52,7 +50,7 @@ jobs:
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Build Native with Maven
if: ${{ github.event_name == 'pull_request' }}
run: ./mvnw -s custom_maven_settings.xml -B clean verify -P native
run: ./mvnw -s custom_maven_settings.xml -B -P native clean verify
- name: Build with Maven
if: ${{ github.event_name == 'push' }}
run: ./mvnw -s custom_maven_settings.xml -B clean verify
2 changes: 1 addition & 1 deletion .github/workflows/release-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
- name: Set up JDK 1.11
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '11'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
push:
branches:
- '**'
- '!main'
- '!develop'
pull_request:
branches:
- 'main'
Expand All @@ -28,7 +26,7 @@ jobs:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '11'
Expand Down
50 changes: 20 additions & 30 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,10 @@ SPDX-License-Identifier: Apache-2.0
<packaging>jar</packaging>

<properties>
<quarkus.platform.version>2.4.2.Final</quarkus.platform.version>

<quarkus.container-image.group>lfenergy</quarkus.container-image.group>
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-universe-bom</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.lfenergy.compas.scl.data</groupId>
Expand Down Expand Up @@ -166,34 +152,38 @@ SPDX-License-Identifier: Apache-2.0
</goals>
</execution>
<execution>
<id>build-basex</id>
<id>build-postgresql</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<properties>
<quarkus.profile>prod-basex</quarkus.profile>
<quarkus.package.output-directory>basex-quarkus-app</quarkus.package.output-directory>
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-basex.jvm</quarkus.docker.dockerfile-jvm-path>
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-basex.native</quarkus.docker.dockerfile-native-path>
<quarkus.container-image.tag>${project.version}-basex</quarkus.container-image.tag>
<quarkus.container-image.additional-tags>latest-basex</quarkus.container-image.additional-tags>
<quarkus.profile>prod-postgresql</quarkus.profile>
<quarkus.package.output-directory>postgresql-quarkus-app</quarkus.package.output-directory>
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-postgresql.jvm</quarkus.docker.dockerfile-jvm-path>
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-postgresql.native</quarkus.docker.dockerfile-native-path>
<quarkus.container-image.tag>${project.version}-postgresql</quarkus.container-image.tag>
<quarkus.container-image.additional-tags>latest-postgresql</quarkus.container-image.additional-tags>
</properties>
</configuration>
</execution>
<!-- Put this build execution as last, because we will use this image to do a basic native check (NativeHealthCheckIT).
This information is written in "target\quarkus-artifact.properties" and used by the integration tests (failsafe).
Sadly there is only 1 file create, so this build overwrites the one from postgresql.
-->
<execution>
<id>build-postgresql</id>
<id>build-basex</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<properties>
<quarkus.profile>prod-postgresql</quarkus.profile>
<quarkus.package.output-directory>postgresql-quarkus-app</quarkus.package.output-directory>
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-postgresql.jvm</quarkus.docker.dockerfile-jvm-path>
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-postgresql.native</quarkus.docker.dockerfile-native-path>
<quarkus.container-image.tag>${project.version}-postgresql</quarkus.container-image.tag>
<quarkus.container-image.additional-tags>latest-postgresql</quarkus.container-image.additional-tags>
<quarkus.profile>prod-basex</quarkus.profile>
<quarkus.package.output-directory>basex-quarkus-app</quarkus.package.output-directory>
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-basex.jvm</quarkus.docker.dockerfile-jvm-path>
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-basex.native</quarkus.docker.dockerfile-native-path>
<quarkus.container-image.tag>${project.version}-basex</quarkus.container-image.tag>
<quarkus.container-image.additional-tags>latest-basex</quarkus.container-image.additional-tags>
</properties>
</configuration>
</execution>
Expand All @@ -219,8 +209,8 @@ SPDX-License-Identifier: Apache-2.0

<properties>
<quarkus.package.type>native</quarkus.package.type>
<!-- Allows for creating a Linux executable without GraalVM being installed -->
<quarkus.native.container-build>true</quarkus.native.container-build>
<quarkus.native.container-build>true</quarkus.native.container-build> <!-- Allows for creating a Linux executable without GraalVM being installed -->
<quarkus.container-image.build>true</quarkus.container-image.build> <!-- Also make a Docker Image, so the native test will be executed against the container -->
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

package org.lfenergy.compas.scl.data.rest;

import io.quarkus.test.junit.NativeImageTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;

@NativeImageTest
@QuarkusIntegrationTest
class NativeHealthCheckIT extends HealthCheckTest {
// Execute the same tests but in native mode.
}
16 changes: 16 additions & 0 deletions doc/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ SPDX-License-Identifier: Apache-2.0

# PostgreSQL Implementation

## PostgreSQL Environment variables

Below environment variable(s) can be used to configure the connection to PostgreSQL, if PostgreSQL Server is used.

| Environment variable | Java Property | Description | Example |
| -------------------------------- | --------------------------- | --------------------------------------------- | ---------------- |
| POSTGRESQL_HOST | - | Name of the Host where PostgreSQL runs. | localhost |
| POSTGRESQL_PORT | - | Port on the Host on which PostgreSQL runs. | 5432 |
| POSTGRESQL_DB | - | The database used in PostgreSQL | compas |
| POSTGRESQL_USERNAME | quarkus.datasource.username | Username under which the application logs in. | postgres |
| POSTGRESQL_PASSWORD | quarkus.datasource.password | Password of the username used above. | postgres |

The variables POSTGRESQL_HOST, POSTGRESQL_PORT and POSTGRESQL_DB are used to created the JDBC URL in the property file.
The value is build like 'jdbc:postgresql://${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DB}'. The variables have
respectively the following defaults, 'localhost', '5432' and 'compas'.

## Database Model

For the SCL Data Service the following table is automatically created using FlyWay.
Expand Down
69 changes: 11 additions & 58 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ SPDX-License-Identifier: Apache-2.0
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>

<compas.core.version>0.6.0</compas.core.version>
<jakarta-bind-api.version>2.3.3</jakarta-bind-api.version>

<quarkus.platform.version>2.4.2.Final</quarkus.platform.version>
<jaxb-impl.version>2.3.5</jaxb-impl.version>
<jakarta-cdi-api.version>2.0.2</jakarta-cdi-api.version>
<microprofile-config-api.version>2.0</microprofile-config-api.version>
<microprofile-openapi-api.version>3.0-RC5</microprofile-openapi-api.version>
<apache.commons-io.version>2.11.0</apache.commons-io.version>
<flyway.version>7.15.0</flyway.version>
<postgresql.version>42.3.1</postgresql.version>
<microprofile-openapi-api.version>3.0</microprofile-openapi-api.version>
<slf4j.version>1.7.32</slf4j.version>

<!-- Test -->
<junit-jupiter.version>5.8.1</junit-jupiter.version>
<mockito-junit-jupiter.version>4.1.0</mockito-junit-jupiter.version>
<openpojo.version>0.9.1</openpojo.version>
</properties>

Expand Down Expand Up @@ -67,6 +59,14 @@ SPDX-License-Identifier: Apache-2.0

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-universe-bom</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.lfenergy.compas.scl.data</groupId>
<artifactId>service</artifactId>
Expand Down Expand Up @@ -99,50 +99,18 @@ SPDX-License-Identifier: Apache-2.0
<version>${compas.core.version}</version>
</dependency>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jakarta-bind-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb-impl.version}</version>
</dependency>

<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${jakarta-cdi-api.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${microprofile-config-api.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.openapi</groupId>
<artifactId>microprofile-openapi-api</artifactId>
<version>${microprofile-openapi-api.version}</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${apache.commons-io.version}</version>
</dependency>

<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand All @@ -163,21 +131,6 @@ SPDX-License-Identifier: Apache-2.0
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito-junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>com.openpojo</groupId>
<artifactId>openpojo</artifactId>
Expand Down
1 change: 0 additions & 1 deletion repository-postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ SPDX-License-Identifier: Apache-2.0
<artifactId>repository</artifactId>
</dependency>


<!-- Test Dependencies -->
<dependency>
<groupId>org.lfenergy.compas.scl.data</groupId>
Expand Down
4 changes: 2 additions & 2 deletions repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ SPDX-License-Identifier: Apache-2.0
<artifactId>microprofile-openapi-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Element addCompasElement(Element compasPrivate, String localName, String
* @return The Hitem created and added to the History Element.
*/
public Element addHistoryItem(Element header, String who, String fullmessage, Version version) {
var formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssXXX");
var formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
var document = header.getOwnerDocument();

var history = getChildNodesByName(header, SCL_HISTORY_ELEMENT_NAME).stream().findFirst()
Expand Down

0 comments on commit 5c43142

Please sign in to comment.