Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- main
paths:
- 'api/**'
- 'Dockerfile'
- '.github/workflows/*'
jobs:
quality_profile:

Expand All @@ -20,11 +22,12 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 18
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 18
java-version: '21'
check-latest: true
- uses: actions/cache@v4
with:
path: ~/.m2/repository
Expand All @@ -33,11 +36,6 @@ jobs:
${{ runner.os }}-maven-5Jun-
- name: Run unit tests
run: mvn -f pom.xml clean package
- name: Set up JDK 21 for Sonar
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 21
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
Expand Down
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
FROM artifacts.developer.gov.bc.ca/docker-remote/maven:3.8.7-openjdk-18 as build
FROM artifacts.developer.gov.bc.ca/docker-remote/maven:3.9.9-amazoncorretto-21-alpine AS maven

# Use the timezone-patched JDK for both compilation and the final runtime.
FROM artifacts.developer.gov.bc.ca/docker-remote/amazoncorretto:21.0.12-alpine3.23 AS build
COPY --from=maven /usr/share/maven /usr/share/maven
ENV PATH="/usr/share/maven/bin:${PATH}"
WORKDIR /workspace/app

COPY api/pom.xml .
COPY api/src src
RUN mvn package -DskipTests
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)

FROM artifacts.developer.gov.bc.ca/docker-remote/openjdk:18.0.2.1-jdk-oracle
RUN useradd -ms /bin/bash spring && mkdir -p /logs && chown -R spring:spring /logs && chmod 755 /logs
FROM artifacts.developer.gov.bc.ca/docker-remote/amazoncorretto:21.0.12-alpine3.23
RUN adduser -D -h /home/spring -s /bin/sh spring && mkdir -p /logs && chown -R spring:spring /logs && chmod 755 /logs
USER spring
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/target/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-Duser.name=EDUC_GRAD_RULE_ENGINE_API","-Xms512m","-Xmx512m","-noverify","-XX:TieredStopAtLevel=1",\
ENTRYPOINT ["java","-Duser.name=EDUC_GRAD_RULE_ENGINE_API","-Xms512m","-Xmx512m","-XX:TieredStopAtLevel=1",\
"-XX:+UseParallelGC","-XX:MinHeapFreeRatio=20","-XX:MaxHeapFreeRatio=40","-XX:GCTimeRatio=4",\
"-XX:AdaptiveSizePolicyWeight=90","-XX:MaxMetaspaceSize=100m","-XX:ParallelGCThreads=1",\
"-XX:AdaptiveSizePolicyWeight=90","-XX:MaxMetaspaceSize=300m","-XX:ParallelGCThreads=1",\
"-Djava.util.concurrent.ForkJoinPool.common.parallelism=1","-XX:CICompilerCount=2",\
"-XX:+ExitOnOutOfMemoryError","-Djava.security.egd=file:/dev/./urandom",\
"-Dspring.backgroundpreinitializer.ignore=true","-cp","app:app/lib/*",\
Expand Down
20 changes: 15 additions & 5 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.2</version>
<version>3.0.13</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>ca.bc.gov.educ</groupId>
Expand All @@ -24,7 +24,10 @@
src/main/java/ca/bc/gov/educ/api/ruleengine/util/**,
src/main/java/ca/bc/gov/educ/api/ruleengine/controller/APIMetadataController.java
</sonar.exclusions>
<java.version>18</java.version>
<java.version>21</java.version>
<lombok.version>1.18.32</lombok.version>
<jacoco.version>0.8.12</jacoco.version>
<byte-buddy.version>1.14.19</byte-buddy.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand Down Expand Up @@ -204,12 +207,12 @@
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.9.1.2184</version>
<version>5.8.0.7211</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -262,7 +265,14 @@
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>6.1.1.Final</version>
<version>${hibernate.version}</version>
<dependencies>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<configuration>
Expand Down
Loading