Skip to content

Commit ec41a56

Browse files
authored
fix: build Docker image from parent directory to resolve dependencies (#28)
# Motivation The Docker image build is failing with dependency resolution error: ``` Could not transfer artifact fr.aneo:armonik-worker-domain:pom:0.1.0 from/to github (https://maven.pkg.github.com/aneoconsulting/ArmoniK.Api): status code: 401, reason phrase: Unauthorized (401) ``` This prevents the release workflow from completing successfully. # Description ## Root Cause The Docker build step was running from the `worker/armonik-worker` subdirectory: ```yaml - name: Build and push Docker image working-directory: worker/armonik-worker run: ./mvnw -B -ntp clean package -Pdocker ``` When Maven runs from a subdirectory, it cannot see sibling modules in the reactor. The `armonik-worker` module depends on `armonik-worker-domain`, but Maven couldn't find it locally and tried to download it from external repositories: 1. Looked in GitHub Packages (requires authentication, returns 401) 2. Version `0.1.0` doesn't exist in GitHub Packages yet 3. Build fails ## Solution Build from the parent `worker` directory instead: ```yaml - name: Build and push Docker image working-directory: worker run: ./mvnw -B -ntp clean package -Pdocker ``` This enables Maven to: 1. See the multi-module reactor (parent + armonik-worker-domain + armonik-worker) 2. Build `armonik-worker-domain` from local source 3. Build `armonik-worker` with access to the freshly built dependency 4. Execute the Docker profile (only affects armonik-worker, which has the jib plugin) No external repository access needed - everything builds from source. ## Changes Made Changed `working-directory` from `worker/armonik-worker` to `worker` in the "Build and push Docker image" step. # Testing ## Expected Behavior - Maven builds the full reactor from the worker directory - `armonik-worker-domain` is built first (no download needed) - `armonik-worker` is built with the Docker profile active - Docker image is created and pushed successfully
2 parents 7404f69 + 8085727 commit ec41a56

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
publish-docker-image:
121121
name: Build and publish Docker image
122122
runs-on: ubuntu-latest
123-
needs: [extract-version, publish-modules]
123+
needs: [ extract-version, publish-modules ]
124124

125125
steps:
126126
- name: Checkout
@@ -138,7 +138,7 @@ jobs:
138138
run: ./mvnw -B -ntp versions:set -DnewVersion=${{ needs.extract-version.outputs.version }} -DprocessAllModules=true -DgenerateBackupPoms=false
139139

140140
- name: Build and push Docker image
141-
working-directory: worker/armonik-worker
141+
working-directory: worker
142142
run: ./mvnw -B -ntp clean package -Pdocker
143143
env:
144144
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_LOGIN }}

0 commit comments

Comments
 (0)