Skip to content

Commit 6b7981f

Browse files
committed
module -> pom_dir
1 parent efbba76 commit 6b7981f

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.github/workflows/authorization.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ jobs:
1818
unit-test:
1919
uses: making/oauth2-sso-demo/.github/workflows/unit-test.yaml@main
2020
with:
21-
module: authorization
21+
pom_dir: authorization
2222
build-oci-image-jvm-amd64:
2323
needs: unit-test
2424
uses: making/oauth2-sso-demo/.github/workflows/build-oci-image-jvm.yaml@main
2525
with:
26-
module: authorization
26+
pom_dir: authorization
2727
image_name: authorization_jvm_amd64
2828
image_file: authorization_jvm_amd64.yaml
2929
runs_on: ubuntu-latest
3030
build-oci-image-jvm-aarch64:
3131
needs: unit-test
3232
uses: making/oauth2-sso-demo/.github/workflows/build-oci-image-jvm.yaml@main
3333
with:
34-
module: authorization
34+
pom_dir: authorization
3535
image_name: authorization_jvm_aarch64
3636
image_file: authorization_jvm_aarch64.yaml
3737
runs_on: raspberrypi

.github/workflows/build-oci-image-jvm.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: Build OCI Image (JVM)
22
on:
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

.github/workflows/unit-test.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: Unit Test
22
on:
33
workflow_call:
44
inputs:
5-
module:
6-
required: true
5+
pom_dir:
6+
required: false
77
type: string
8+
default: '.'
89
jobs:
910
build:
1011
runs-on: ubuntu-latest
@@ -19,4 +20,4 @@ jobs:
1920
distribution: graalvm
2021
cache: 'maven'
2122
- name: unit test
22-
run: ./mvnw -V -f ${{ inputs.module }} clean test --no-transfer-progress
23+
run: ./mvnw -V -f ${{ inputs.pom_dir }} clean test --no-transfer-progress

0 commit comments

Comments
 (0)