@@ -2,9 +2,10 @@ name: Build OCI Image (JVM)
22on :
33 workflow_call :
44 inputs :
5- module :
6- required : true
5+ pom_dir :
6+ required : false
77 type : string
8+ default : ' .'
89 image_name :
910 required : false
1011 type : string
@@ -36,13 +37,13 @@ jobs:
3637 cache : ' maven'
3738 - name : Set version
3839 run : |
39- CURRENT_VERSION=$(./mvnw -f ${{ inputs.module }} help:evaluate -Dexpression=project.version -q -DforceStdout)
40+ CURRENT_VERSION=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=project.version -q -DforceStdout)
4041 NEW_VERSION=$(echo $CURRENT_VERSION | sed "s/-SNAPSHOT/.${GITHUB_SHA}/")
41- ./mvnw -f ${{ inputs.module }} versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false --no-transfer-progress
42+ ./mvnw -f ${{ inputs.pom_dir }} versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false --no-transfer-progress
4243 - name : build image (Paketo Buildpack)
4344 run : |
44- OS_ARCH=$(./mvnw -f ${{ inputs.module }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
45- ./mvnw -V -f ${{ inputs.module }} --no-transfer-progress spring-boot:build-image -DskipTests -Dspring-boot.build-image.imageName=ghcr.io/${{ github.repository }}/${{ inputs.module }}:jvm_${OS_ARCH}_${GITHUB_SHA}
45+ OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
46+ ./mvnw -V -f ${{ inputs.pom_dir }} --no-transfer-progress spring-boot:build-image -DskipTests -Dspring-boot.build-image.imageName=ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA}
4647 - name : Login to GitHub Container Registry
4748 if : github.ref == inputs.target_ref
4849 uses : docker/login-action@v3
@@ -53,16 +54,16 @@ jobs:
5354 - name : docker push
5455 if : github.ref == inputs.target_ref
5556 run : |
56- OS_ARCH=$(./mvnw -f ${{ inputs.module }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
57- docker push ghcr.io/${{ github.repository }}/${{ inputs.module }}:jvm_${OS_ARCH}_${GITHUB_SHA}
58- docker tag ghcr.io/${{ github.repository }}/${{ inputs.module }}:jvm_${OS_ARCH}_${GITHUB_SHA} ghcr.io/${{ github.repository }}/${{ inputs.module }}:jvm_${OS_ARCH}
59- docker push ghcr.io/${{ github.repository }}/${{ inputs.module }}:jvm_${OS_ARCH}
57+ OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
58+ docker push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA}
59+ docker tag ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA} ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}
60+ docker push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}
6061 - name : Generate digest
6162 if : github.ref == inputs.target_ref
6263 run : |
63- OS_ARCH=$(./mvnw -f ${{ inputs.module }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
64+ OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
6465 cat <<EOF > ${{ inputs.image_file }}
65- image: $(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository }}/${{ inputs.module }}:jvm_${OS_ARCH}_${GITHUB_SHA})
66+ image: $(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA})
6667 git_revision: ${GITHUB_SHA}
6768 EOF
6869 - name : Upload artifact
0 commit comments