@@ -8,7 +8,6 @@ FROM oci.stackable.tech/sdp/git-sync/git-sync:${GIT_SYNC} AS git-sync-image
88FROM  stackable/image/java-devel AS nifi-builder
99
1010ARG  PRODUCT
11- ARG  RELEASE
1211ARG  MAVEN_VERSION="3.9.8" 
1312ARG  STACKABLE_USER_UID
1413
@@ -46,13 +45,8 @@ curl 'https://repo.stackable.tech/repository/m2/tech/stackable/nifi/stackable-bc
4645
4746cd "$(/stackable/patchable --images-repo-root=src checkout nifi ${PRODUCT})" 
4847
49- ORIGINAL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
50- NEW_VERSION="${PRODUCT}-stackable${RELEASE}" 
51- 
52- mvn versions:set -DnewVersion=$NEW_VERSION
53- 
5448#  Create snapshot of the source code including custom patches
55- tar -czf /stackable/nifi-${NEW_VERSION }-src.tar.gz .
49+ tar -czf /stackable/nifi-${PRODUCT }-src.tar.gz .
5650
5751#  NOTE: Since NiFi 2.0.0 PutIceberg Processor and services were removed, so including the `include-iceberg` profile does nothing.
5852#  Additionally some modules were moved to optional build profiles, so we need to add `include-hadoop` to get `nifi-parquet-nar` for example.
6357fi
6458
6559#  Copy the binaries to the /stackable folder
66- mv nifi-assembly/target/nifi-${NEW_VERSION }-bin/nifi-${NEW_VERSION } /stackable/nifi-${NEW_VERSION }
60+ mv nifi-assembly/target/nifi-${PRODUCT }-bin/nifi-${PRODUCT } /stackable/nifi-${PRODUCT }
6761
6862#  Copy the SBOM as well
69- sed -i "s/${NEW_VERSION}/${ORIGINAL_VERSION}/g"  nifi-assembly/target/bom.json
70- mv nifi-assembly/target/bom.json /stackable/nifi-${NEW_VERSION}/nifi-${NEW_VERSION}.cdx.json
63+ mv nifi-assembly/target/bom.json /stackable/nifi-${PRODUCT}/nifi-${PRODUCT}.cdx.json
7164
7265#  Get a list of NARs
73- export NARS=$(ls /stackable/nifi-${NEW_VERSION }/lib/*.nar | awk -F '/'  '{ print $5 }'  | sed "s/\- ${NEW_VERSION }.nar\$ //g" )
66+ export NARS=$(ls /stackable/nifi-${PRODUCT }/lib/*.nar | awk -F '/'  '{ print $5 }'  | sed "s/\- ${PRODUCT }.nar\$ //g" )
7467#  Get a list of SBOMs
7568find . -name bom.json > bomlist.txt
7669
@@ -79,15 +72,15 @@ for nar in $NARS; do
7972    match=$(grep "\/ $nar\/ target\/ bom.json"  bomlist.txt || true)
8073    if [[ -n "$match"  ]]; then
8174        #  Copy the SBOM of the NAR
82-         cp "$match"  "/stackable/nifi-${NEW_VERSION }/$nar.cdx.json" 
75+         cp "$match"  "/stackable/nifi-${PRODUCT }/$nar.cdx.json" 
8376    fi
8477done
8578
8679#  Remove sources
8780(cd .. && rm -r ${PRODUCT})
8881
8982#  Remove generated docs in binary
90- rm -rf /stackable/nifi-${NEW_VERSION }/docs
83+ rm -rf /stackable/nifi-${PRODUCT }/docs
9184
9285#  Set correct permissions
9386chmod -R g=u /stackable
@@ -189,15 +182,15 @@ LABEL name="Apache NiFi" \
189182    summary="The Stackable image for Apache NiFi."  \
190183    description="This image is deployed by the Stackable Operator for Apache NiFi." 
191184
192- COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT}-stackable${RELEASE}  /stackable/nifi-${PRODUCT}-stackable${RELEASE }/
193- COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT}-stackable${RELEASE}- src.tar.gz /stackable
185+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
186+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT}-src.tar.gz /stackable
194187COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
195- COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}-stackable${RELEASE} /lib/
196- COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.cdx.json /stackable/nifi-${PRODUCT}-stackable${RELEASE} /lib/
188+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}/lib/
189+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.cdx.json /stackable/nifi-${PRODUCT}/lib/
197190COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*-src.tar.gz /stackable
198191COPY  --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
199192
200- COPY  --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/opa-authorizer.nar /stackable/nifi-${PRODUCT}-stackable${RELEASE} /extensions/opa-authorizer.nar
193+ COPY  --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/opa-authorizer.nar /stackable/nifi-${PRODUCT}/extensions/opa-authorizer.nar
201194COPY  --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/nifi-opa-plugin-${NIFI_OPA_AUTHORIZER_PLUGIN}-src.tar.gz  /stackable
202195COPY  --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/LICENSE /licenses/NIFI_OPA_PLUGIN_LICENSE
203196COPY  --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin
@@ -226,13 +219,13 @@ pip install --no-cache-dir \
226219#  This can be removed once older versions / operators using this are no longer supported
227220ln -s /stackable/stackable-bcrypt.jar /bin/stackable-bcrypt.jar
228221
229- ln -s /stackable/nifi-${PRODUCT}-stackable${RELEASE}  /stackable/nifi
222+ ln -s /stackable/nifi-${PRODUCT} /stackable/nifi
230223
231224#  fix missing permissions / ownership
232225chown --no-dereference ${STACKABLE_USER_UID}:0 /stackable/nifi
233226chmod --recursive g=u /stackable/python
234227chmod --recursive g=u /stackable/bin
235- chmod g=u /stackable/nifi-${PRODUCT}-stackable${RELEASE} 
228+ chmod g=u /stackable/nifi-${PRODUCT}
236229chmod g=u /stackable/*-src.tar.gz
237230EOF
238231
0 commit comments