Skip to content

Commit 515e245

Browse files
committed
Merge branch 'master' into develop
# Conflicts: # hello/src/main/java/com/ak/app/MainApp.java
2 parents d6620de + 2173836 commit 515e245

21 files changed

Lines changed: 92 additions & 94 deletions

.github/workflows/actions.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,44 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818
with:
1919
fetch-depth: 0
20-
- uses: actions/setup-java@v4
20+
- uses: actions/setup-java@v5
2121
with:
2222
distribution: oracle
23-
java-version: 23
23+
java-version: 25
2424
cache: 'gradle'
2525
- name: Setup Gradle
26-
uses: gradle/actions/setup-gradle@v4
26+
uses: gradle/actions/setup-gradle@73536630a5c2294ff55c4e352d46981d96c301d9
2727
with:
28-
gradle-version: '8.12.1'
28+
gradle-version: '9.4.0'
2929
- name: Cache SonarCloud packages
30-
uses: actions/cache@v4
30+
uses: actions/cache@v5
3131
with:
3232
path: ~/.sonar/cache
33-
key: ${{ runner.os }}-sonar
34-
restore-keys: ${{ runner.os }}-sonar
33+
key: ${{ runner.os }}-sonar-${{ hashFiles('**/build.gradle') }}
34+
restore-keys: ${{ runner.os }}-sonar-
3535
- name: Cache Gradle packages
36-
uses: actions/cache@v4
36+
uses: actions/cache@v5
3737
with:
38-
path: ~/.gradle/caches
39-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
40-
restore-keys: ${{ runner.os }}-gradle
38+
path: |
39+
~/.gradle/caches
40+
~/.gradle/wrapper
41+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
42+
restore-keys: ${{ runner.os }}-gradle-
4143
- name: Build and analyze
4244
env:
4345
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
44-
run: gradle build jacocoAggregatedReport sonar --info
46+
run: gradle build jacocoTestReport sonar --info
4547
- name: Compute version
4648
run: |
4749
gradle version
4850
echo "BUILD_VERSION=$(gradle version | grep Version | awk '{ print $2 }')" >> $GITHUB_ENV
4951
- name: Login to Docker Hub
50-
run: docker login -u $DOCKER_USER -p ${{ secrets.DOCKER_PASSWORD }}
52+
env:
53+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
54+
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
5155
- name: Build and tag the Docker image
5256
run: docker build -t $DOCKER_USER/$DOCKER_IMAGE:${{ env.BUILD_VERSION }} -t $DOCKER_USER/$DOCKER_IMAGE:latest .
5357
- name: Push the Docker image

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ profile
3535

3636
# TLS Certificates
3737
.certs/
38+
39+
# Logs
40+
*.log
41+
log*.gz
42+
log*.tmp

.idea/compiler.xml

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/SimpleApp__sonarqube_.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
FROM openjdk:23
1+
FROM openjdk:25-jdk-slim@sha256:4d9bb48a3d5c2015a5e67eeab7575b6b11eda252aee651e632ef57d24aaf2d82
22

33
# Create a custom user with UID 1234 and GID 1234
44
# https://www.docker.com/blog/understanding-the-docker-user-instruction/
5-
RUN groupadd -g 1234 customgroup && \
6-
useradd -m -u 1234 -g customgroup customuser
5+
RUN groupadd -g 1234 runner-group && \
6+
useradd -m -u 1234 -g runner-group runner
77

8-
# Switch to the custom user
9-
USER customuser
8+
# Set the directory for executing future commands
9+
WORKDIR /home/runner
1010

11-
# Copy the app files from host machine to image filesystem
12-
COPY --link hello/build/libs/hello-all.jar /home/customuser/hello-all.jar
11+
# Extract from .tar and copy the app files from host machine to image filesystem
12+
ADD hello/build/distributions/hello-*.tar .
13+
RUN mv hello-* app && chown -R runner:runner-group app && mkdir data && chown -R runner:runner-group data
1314

14-
# Set the directory for executing future commands
15-
WORKDIR /home/customuser
15+
# Switch to the custom user
16+
USER runner
1617

1718
# Run the Main class
1819
# https://docs.docker.com/reference/build-checks/json-args-recommended/
19-
ENTRYPOINT ["java", "-jar", "/home/customuser/hello-all.jar"]
20+
ENTRYPOINT ["/home/runner/app/bin/hello"]
21+
22+
EXPOSE 8080/tcp

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
### Update version and add git tag
2222

2323
```shell
24-
git tag 2025.01
24+
git tag 2026.01
2525
```
2626

2727
## Update dependencies

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ plugins {
66
id 'jacoco'
77
alias(libs.plugins.spotbugs)
88
alias(libs.plugins.ben.manes.versions)
9-
alias(libs.plugins.nebula.lint)
109
alias(libs.plugins.sonarqube)
1110
alias(libs.plugins.jacocolog)
1211
alias(libs.plugins.jgitver)
@@ -52,7 +51,7 @@ allprojects {
5251
}
5352

5453
jacoco {
55-
toolVersion = '0.8.12'
54+
toolVersion = '0.8.14'
5655
}
5756

5857
jacocoTestReport {
@@ -73,7 +72,7 @@ subprojects {
7372

7473
java {
7574
toolchain {
76-
languageVersion = JavaLanguageVersion.of(23)
75+
languageVersion = JavaLanguageVersion.of(25)
7776
}
7877
}
7978

docker-compose.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
services:
22
simple-app:
33
container_name: simple-app
4-
image: a002k/simple-app:latest
4+
image: a002k/simple-app:latest
5+
volumes:
6+
- simple-app:/home/runner/data
7+
8+
volumes:
9+
simple-app:

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
22
org.gradle.caching=true
3-
org.gradle.parallel=true
3+
org.gradle.parallel=false
4+
org.gradle.configuration-cache=false
45
dependency.analysis.print.build.health=true
56
sonar.projectKey=ak-git_SimpleApp
67
sonar.organization=ak-git

0 commit comments

Comments
 (0)