From dc19f51c45d3baffe63837b34724ee14039d52a0 Mon Sep 17 00:00:00 2001 From: Jelle Hoffman Date: Wed, 22 Jan 2025 15:13:52 +0100 Subject: [PATCH 1/3] FDP-2849: Adding organisation certs to container --- .github/workflows/build.yml | 20 ++++++++++++++++--- .../cucumber-tests-platform-common/Dockerfile | 3 ++- .../Dockerfile | 3 ++- .../Dockerfile | 3 ++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e0f5d1f9bd..a77e92c0671 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,11 +103,14 @@ jobs: - image: ghcr.io/osgp/osgp-web-device-simulator context: ./osgp/protocol-adapter-oslp/web-device-simulator - image: ghcr.io/osgp/osgp-cucumber-tests-platform-common - context: ./integration-tests/cucumber-tests-platform-common + context: ./integration-tests + file: /cucumber-tests-platform-common/Dockerfile - image: ghcr.io/osgp/osgp-cucumber-tests-platform-publiclighting - context: ./integration-tests/cucumber-tests-platform-publiclighting + context: ./integration-tests + file: /cucumber-tests-platform-publiclighting/Dockerfile - image: ghcr.io/osgp/osgp-cucumber-tests-platform-smartmetering - context: ./integration-tests/cucumber-tests-platform-smartmetering + context: ./integration-tests + file: /cucumber-tests-platform-smartmetering/Dockerfile steps: - name: Checkout uses: actions/checkout@v4 @@ -130,11 +133,22 @@ jobs: - name: Build and push Docker image id: push uses: docker/build-push-action@v6 + if: ${{ matrix.file == null }} with: context: ${{ matrix.context }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: Build and push Docker image with file path + id: push + uses: docker/build-push-action@v6 + if: ${{ matrix.file != null }} + with: + context: ${{ matrix.context }} + file: ${{ matrix.context }}${{ matrix.file }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: diff --git a/integration-tests/cucumber-tests-platform-common/Dockerfile b/integration-tests/cucumber-tests-platform-common/Dockerfile index f5b1097fe70..b678b0d87d7 100644 --- a/integration-tests/cucumber-tests-platform-common/Dockerfile +++ b/integration-tests/cucumber-tests-platform-common/Dockerfile @@ -1,6 +1,7 @@ FROM eclipse-temurin:17 WORKDIR / -COPY target/cucumber-*-test-jar-with-dependencies.jar / +COPY cucumber-tests-platform-common/target/cucumber-*-test-jar-with-dependencies.jar / +COPY certificates /etc/ssl/certs/organisations/ RUN wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar CMD java -javaagent:org.jacoco.agent-0.8.12-runtime.jar=destfile=/target/code-coverage/jacoco-it.exec \ -Dcucumber.execution.strict=true\ diff --git a/integration-tests/cucumber-tests-platform-publiclighting/Dockerfile b/integration-tests/cucumber-tests-platform-publiclighting/Dockerfile index f5b1097fe70..cfaef0f902e 100644 --- a/integration-tests/cucumber-tests-platform-publiclighting/Dockerfile +++ b/integration-tests/cucumber-tests-platform-publiclighting/Dockerfile @@ -1,6 +1,7 @@ FROM eclipse-temurin:17 WORKDIR / -COPY target/cucumber-*-test-jar-with-dependencies.jar / +COPY cucumber-tests-platform-publiclighting/target/cucumber-*-test-jar-with-dependencies.jar / +COPY certificates /etc/ssl/certs/organisations/ RUN wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar CMD java -javaagent:org.jacoco.agent-0.8.12-runtime.jar=destfile=/target/code-coverage/jacoco-it.exec \ -Dcucumber.execution.strict=true\ diff --git a/integration-tests/cucumber-tests-platform-smartmetering/Dockerfile b/integration-tests/cucumber-tests-platform-smartmetering/Dockerfile index f5b1097fe70..774a70c6e96 100644 --- a/integration-tests/cucumber-tests-platform-smartmetering/Dockerfile +++ b/integration-tests/cucumber-tests-platform-smartmetering/Dockerfile @@ -1,6 +1,7 @@ FROM eclipse-temurin:17 WORKDIR / -COPY target/cucumber-*-test-jar-with-dependencies.jar / +COPY cucumber-tests-platform-smartmetering/target/cucumber-*-test-jar-with-dependencies.jar / +COPY certificates /etc/ssl/certs/organisations/ RUN wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar CMD java -javaagent:org.jacoco.agent-0.8.12-runtime.jar=destfile=/target/code-coverage/jacoco-it.exec \ -Dcucumber.execution.strict=true\ From 2347949fb6d2b9415518a5554e4bba3f86eb6c0b Mon Sep 17 00:00:00 2001 From: Jelle Hoffman Date: Wed, 22 Jan 2025 15:20:58 +0100 Subject: [PATCH 2/3] FDP-2849: Rename ID --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a77e92c0671..0cb26086b2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,7 +140,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker image with file path - id: push + id: pushWithFile uses: docker/build-push-action@v6 if: ${{ matrix.file != null }} with: From 69bf394bd46596023a005011395c21ad67283cff Mon Sep 17 00:00:00 2001 From: Jelle Hoffman Date: Wed, 22 Jan 2025 15:36:07 +0100 Subject: [PATCH 3/3] FDP-2849: Adding extra artifact attestation --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cb26086b2f..5e4b81e4844 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,6 +151,13 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 + if: ${{ matrix.file == null }} with: subject-name: ${{ matrix.image }} subject-digest: ${{ steps.push.outputs.digest }} + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + if: ${{ matrix.file != null }} + with: + subject-name: ${{ matrix.image }} + subject-digest: ${{ steps.pushWithFile.outputs.digest }}