Skip to content

Commit

Permalink
adds fix for registry jar file location
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronzi committed Dec 6, 2024
1 parent a241994 commit fc6f8ff
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/docker-snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,28 @@ jobs:
- name: Install BaSyx
run: mvn clean install -DskipTests

- name: Determine FINAL_NAME for registry
- name: Prepare Registry JAR for Docker
if: contains(matrix.name, 'registry')
run: |
JAR_FILE=$(ls "${{ matrix.path }}/maven/"*.jar | head -n 1)
# module_root goes two directories up from src/main/docker
module_root=$(dirname "$(dirname "${{ matrix.path }}")")
# Find the JAR in the module's target directory
JAR_FILE=$(ls "$module_root/target/"*.jar | head -n 1)
if [ -z "$JAR_FILE" ]; then
echo "No JAR found in ${ { matrix.path } }/maven. Check build outputs."
echo "No JAR found in $module_root/target. Check your build."
exit 1
fi
# Create the maven directory inside the Docker context and copy the JAR there
mkdir -p "${{ matrix.path }}/maven"
cp "$JAR_FILE" "${{ matrix.path }}/maven/"
# Extract the final name without .jar extension
FINAL_NAME=$(basename "$JAR_FILE" .jar)
echo "FINAL_ARGS=FINAL_NAME=${FINAL_NAME}" >> $GITHUB_ENV
- name: Determine FINAL_NAME for non-registry (no-op)
- name: No-Op for Non-Registry Modules
if: "!contains(matrix.name, 'registry')"
run: echo "FINAL_ARGS=" >> $GITHUB_ENV

Expand Down

0 comments on commit fc6f8ff

Please sign in to comment.