Skip to content

Commit

Permalink
updates dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronzi committed Dec 6, 2024
1 parent 6733b62 commit afcf5fe
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 13 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/docker-snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,30 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Install BaSyx
run: mvn clean install -DskipTests
# Build the project
# For registry modules, we activate the dockerbuild profile and specify the module with --pl
- name: Build BaSyx
run: |
if [[ "${{ matrix.name }}" == *"registry"* ]]; then
# Derive the module's artifactId from the path
module_root=$(dirname "$(dirname "$(dirname "${{ matrix.path }}")")")
artifact_id=$(basename "$module_root")
# Run with dockerbuild profile and namespace
mvn clean install -DskipTests -Pdockerbuild "-Ddocker.namespace=aaronzi" --pl "org.eclipse.digitaltwin.basyx:${artifact_id}"
else
mvn clean install -DskipTests
fi
- name: Prepare Registry JAR for Docker
if: contains(matrix.name, 'registry')
run: |
# Go three levels up from src/main/docker to get the module root
module_root=$(dirname "$(dirname "$(dirname "${{ matrix.path }}")")")
# Find the JAR in the module's target directory
JAR_FILE=$(ls "$module_root/target/"*.jar | head -n 1)
# Find the large JAR after repackage (enabled by dockerbuild profile)
JAR_FILE=$(ls "$module_root/target/"*.jar | grep -v original | head -n 1)
if [ -z "$JAR_FILE" ]; then
echo "No JAR found in $module_root/target. Check your build."
echo "No repackaged JAR found in $module_root/target. Check your build."
exit 1
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17 as builder
ARG FINAL_NAME
ARG FINAL_NAME=${project.build.finalName}
COPY maven/${FINAL_NAME}.jar ./
RUN java -Djarmode=layertools -jar ${FINAL_NAME}.jar extract

Expand Down

0 comments on commit afcf5fe

Please sign in to comment.