@@ -59,6 +59,20 @@ mv nifi-assembly/target/nifi-${PRODUCT}-bin/nifi-${PRODUCT} /stackable/nifi-${PR
5959# Copy the SBOM as well
6060mv nifi-assembly/target/bom.json /stackable/nifi-${PRODUCT}/nifi-${PRODUCT}.cdx.json
6161
62+ # Get a list of NARs
63+ export NARS=$(ls /stackable/nifi-${PRODUCT}/lib/*.nar | awk -F '/' '{ print $5 }' | sed "s/\- ${PRODUCT}.nar\$ //g" )
64+ # Get a list of SBOMs
65+ find . -name bom.json > bomlist.txt
66+
67+ for nar in $NARS; do
68+ # Try to find the NAR in the list of SBOMs
69+ match=$(grep "\/ $nar\/ target\/ bom.json" bomlist.txt || true)
70+ if [[ -n "$match" ]]; then
71+ # Copy the SBOM of the NAR
72+ cp "$match" "/stackable/nifi-${PRODUCT}/$nar.cdx.json"
73+ fi
74+ done
75+
6276# Remove sources
6377(cd .. && rm -r ${PRODUCT})
6478
@@ -100,15 +114,15 @@ if [[ "${PRODUCT}" != 1.* ]] ; then
100114 cp ./nifi-iceberg-services-api-nar/target/nifi-iceberg-services-api-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
101115 cp ./nifi-iceberg-services-nar/target/nifi-iceberg-services-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
102116 cp ./nifi-iceberg-processors-nar/target/nifi-iceberg-processors-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
103- cp ./target/bom.json /stackable/nifi-iceberg-bundle.sbom .json
117+ cp ./target/bom.json /stackable/nifi-iceberg-bundle.cdx .json
104118
105119 cd ..
106120 # Save disk space, even for intermediate images
107121 rm -rf nifi-iceberg-bundle-${NIFI_ICEBERG_BUNDLE}
108122
109123# Set correct groups
110124chmod g=u /stackable/*.nar
111- chmod g=u /stackable/*.sbom .json
125+ chmod g=u /stackable/*.cdx .json
112126fi
113127EOF
114128
@@ -129,7 +143,7 @@ LABEL name="Apache NiFi" \
129143COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
130144COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
131145COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}/lib/
132- COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.sbom .json /stackable/nifi-${PRODUCT}/lib/
146+ COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.cdx .json /stackable/nifi-${PRODUCT}/lib/
133147COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
134148
135149COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin
0 commit comments