Skip to content

Commit 35f8ae5

Browse files
author
Rob Tjalma
authored
Merge pull request #215 from com-pas/jvm-it
Changed build of jvm/native image in POM and Actions.
2 parents 6123a4a + 03463c4 commit 35f8ae5

File tree

5 files changed

+70
-20
lines changed

5 files changed

+70
-20
lines changed

.github/workflows/build-project.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
with:
4949
output_file: custom_maven_settings.xml
5050
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
51-
- name: Build Native with Maven
51+
- name: Build with Maven (Pull Request)
5252
if: ${{ github.event_name == 'pull_request' }}
53-
run: ./mvnw -s custom_maven_settings.xml -B -P native clean verify
54-
- name: Build with Maven
53+
run: ./mvnw -s custom_maven_settings.xml -B -Pnative-image clean verify
54+
- name: Build with Maven (Push)
5555
if: ${{ github.event_name == 'push' }}
5656
run: ./mvnw -s custom_maven_settings.xml -B clean verify

.github/workflows/release-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Release Project
66

77
on:
88
release:
9-
types: [released]
9+
types: [ released ]
1010

1111
jobs:
1212
release_project:
@@ -58,6 +58,6 @@ jobs:
5858
env:
5959
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6060
- name: Deploy with Maven to GitHub Packages and Docker Hub
61-
run: ./mvnw -B -s custom_maven_settings.xml -P release,native clean deploy
61+
run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sonarcloud-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6060
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6161
run: |
62-
./mvnw -s custom_maven_settings.xml -B -P sonar \
62+
./mvnw -s custom_maven_settings.xml -B -Psonar \
6363
-Dsonar.projectKey=com-pas_compas-scl-data-service \
6464
-Dsonar.organization=com-pas \
6565
-Dsonar.host.url=https://sonarcloud.io \

app/pom.xml

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,15 @@ SPDX-License-Identifier: Apache-2.0
163163
<configuration>
164164
<properties>
165165
<quarkus.profile>prod-postgresql</quarkus.profile>
166-
<quarkus.package.output-directory>postgresql-quarkus-app</quarkus.package.output-directory>
167-
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-postgresql.jvm</quarkus.docker.dockerfile-jvm-path>
168-
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-postgresql.native</quarkus.docker.dockerfile-native-path>
166+
<quarkus.package.output-directory>postgresql-quarkus-app
167+
</quarkus.package.output-directory>
168+
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-postgresql.jvm
169+
</quarkus.docker.dockerfile-jvm-path>
170+
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-postgresql.native
171+
</quarkus.docker.dockerfile-native-path>
169172
<quarkus.container-image.tag>${project.version}-postgresql</quarkus.container-image.tag>
170-
<quarkus.container-image.additional-tags>latest-postgresql</quarkus.container-image.additional-tags>
173+
<quarkus.container-image.additional-tags>latest-postgresql
174+
</quarkus.container-image.additional-tags>
171175
</properties>
172176
</configuration>
173177
</execution>
@@ -184,10 +188,13 @@ SPDX-License-Identifier: Apache-2.0
184188
<properties>
185189
<quarkus.profile>prod-basex</quarkus.profile>
186190
<quarkus.package.output-directory>basex-quarkus-app</quarkus.package.output-directory>
187-
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-basex.jvm</quarkus.docker.dockerfile-jvm-path>
188-
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-basex.native</quarkus.docker.dockerfile-native-path>
191+
<quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile-basex.jvm
192+
</quarkus.docker.dockerfile-jvm-path>
193+
<quarkus.docker.dockerfile-native-path>src/main/docker/Dockerfile-basex.native
194+
</quarkus.docker.dockerfile-native-path>
189195
<quarkus.container-image.tag>${project.version}-basex</quarkus.container-image.tag>
190-
<quarkus.container-image.additional-tags>latest-basex</quarkus.container-image.additional-tags>
196+
<quarkus.container-image.additional-tags>latest-basex
197+
</quarkus.container-image.additional-tags>
191198
</properties>
192199
</configuration>
193200
</execution>
@@ -209,12 +216,50 @@ SPDX-License-Identifier: Apache-2.0
209216

210217
<profiles>
211218
<profile>
212-
<id>native</id>
219+
<id>jvm-image</id>
213220

214221
<properties>
222+
<!-- Make a Docker Image, so the integration tests will be executed against the container -->
223+
<quarkus.container-image.build>true</quarkus.container-image.build>
224+
</properties>
225+
226+
<build>
227+
<plugins>
228+
<plugin>
229+
<groupId>org.apache.maven.plugins</groupId>
230+
<artifactId>maven-failsafe-plugin</artifactId>
231+
<version>${surefire-plugin.version}</version>
232+
<executions>
233+
<execution>
234+
<goals>
235+
<goal>integration-test</goal>
236+
<goal>verify</goal>
237+
</goals>
238+
<configuration>
239+
<systemPropertyVariables>
240+
<java.util.logging.manager>
241+
org.jboss.logmanager.LogManager
242+
</java.util.logging.manager>
243+
<maven.home>${maven.home}</maven.home>
244+
</systemPropertyVariables>
245+
</configuration>
246+
</execution>
247+
</executions>
248+
</plugin>
249+
</plugins>
250+
</build>
251+
</profile>
252+
253+
<profile>
254+
<id>native-image</id>
255+
256+
<properties>
257+
<!-- Make a Docker Image, so the integration tests will be executed against the container -->
258+
<quarkus.container-image.build>true</quarkus.container-image.build>
259+
215260
<quarkus.package.type>native</quarkus.package.type>
216-
<quarkus.native.container-build>true</quarkus.native.container-build> <!-- Allows for creating a Linux executable without GraalVM being installed -->
217-
<quarkus.container-image.build>true</quarkus.container-image.build> <!-- Also make a Docker Image, so the native test will be executed against the container -->
261+
<!-- Allows for creating a Linux executable without GraalVM being installed -->
262+
<quarkus.native.container-build>true</quarkus.native.container-build>
218263
</properties>
219264

220265
<build>
@@ -232,8 +277,11 @@ SPDX-License-Identifier: Apache-2.0
232277
</goals>
233278
<configuration>
234279
<systemPropertyVariables>
235-
<native.image.path>${project.build.directory}/basex-quarkus-app/${project.build.finalName}-runner</native.image.path>
236-
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
280+
<native.image.path>
281+
${project.build.directory}/basex-quarkus-app/${project.build.finalName}-runner
282+
</native.image.path>
283+
<java.util.logging.manager>org.jboss.logmanager.LogManager
284+
</java.util.logging.manager>
237285
<maven.home>${maven.home}</maven.home>
238286
</systemPropertyVariables>
239287
</configuration>
@@ -259,8 +307,10 @@ SPDX-License-Identifier: Apache-2.0
259307
<id>release</id>
260308

261309
<properties>
262-
<!-- Properties only used for publishing a native docker image (default to Docker Hub) -->
310+
<!-- Make a Docker Image from the component -->
263311
<quarkus.container-image.build>true</quarkus.container-image.build>
312+
313+
<!-- Properties only used for publishing a native docker image (default to Docker Hub) -->
264314
<quarkus.container-image.push>true</quarkus.container-image.push>
265315
</properties>
266316
</profile>

app/src/test/java/org/lfenergy/compas/scl/data/rest/NativeHealthCheckIT.java renamed to app/src/test/java/org/lfenergy/compas/scl/data/rest/HealthCheckIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
import io.quarkus.test.junit.QuarkusIntegrationTest;
88

99
@QuarkusIntegrationTest
10-
class NativeHealthCheckIT extends HealthCheckTest {
10+
class HealthCheckIT extends HealthCheckTest {
1111
// Execute the same tests but in native mode.
1212
}

0 commit comments

Comments
 (0)