@@ -8,6 +8,7 @@ FROM oci.stackable.tech/sdp/git-sync/git-sync:${GIT_SYNC} AS git-sync-image
8
8
FROM stackable/image/java-devel AS nifi-builder
9
9
10
10
ARG PRODUCT
11
+ ARG RELEASE
11
12
ARG MAVEN_VERSION="3.9.8"
12
13
ARG STACKABLE_USER_UID
13
14
@@ -45,8 +46,13 @@ curl 'https://repo.stackable.tech/repository/m2/tech/stackable/nifi/stackable-bc
45
46
46
47
cd "$(/stackable/patchable --images-repo-root=src checkout nifi ${PRODUCT})"
47
48
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
+
48
54
# Create snapshot of the source code including custom patches
49
- tar -czf /stackable/nifi-${PRODUCT }-src.tar.gz .
55
+ tar -czf /stackable/nifi-${NEW_VERSION }-src.tar.gz .
50
56
51
57
# NOTE: Since NiFi 2.0.0 PutIceberg Processor and services were removed, so including the `include-iceberg` profile does nothing.
52
58
# Additionally some modules were moved to optional build profiles, so we need to add `include-hadoop` to get `nifi-parquet-nar` for example.
57
63
fi
58
64
59
65
# Copy the binaries to the /stackable folder
60
- mv nifi-assembly/target/nifi-${PRODUCT }-bin/nifi-${PRODUCT } /stackable/nifi-${PRODUCT }
66
+ mv nifi-assembly/target/nifi-${NEW_VERSION }-bin/nifi-${NEW_VERSION } /stackable/nifi-${NEW_VERSION }
61
67
62
68
# Copy the SBOM as well
63
- mv nifi-assembly/target/bom.json /stackable/nifi-${PRODUCT}/nifi-${PRODUCT}.cdx.json
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
64
71
65
72
# Get a list of NARs
66
- export NARS=$(ls /stackable/nifi-${PRODUCT }/lib/*.nar | awk -F '/' '{ print $5 }' | sed "s/\- ${PRODUCT }.nar\$ //g" )
73
+ export NARS=$(ls /stackable/nifi-${NEW_VERSION }/lib/*.nar | awk -F '/' '{ print $5 }' | sed "s/\- ${NEW_VERSION }.nar\$ //g" )
67
74
# Get a list of SBOMs
68
75
find . -name bom.json > bomlist.txt
69
76
@@ -72,15 +79,15 @@ for nar in $NARS; do
72
79
match=$(grep "\/ $nar\/ target\/ bom.json" bomlist.txt || true)
73
80
if [[ -n "$match" ]]; then
74
81
# Copy the SBOM of the NAR
75
- cp "$match" "/stackable/nifi-${PRODUCT }/$nar.cdx.json"
82
+ cp "$match" "/stackable/nifi-${NEW_VERSION }/$nar.cdx.json"
76
83
fi
77
84
done
78
85
79
86
# Remove sources
80
87
(cd .. && rm -r ${PRODUCT})
81
88
82
89
# Remove generated docs in binary
83
- rm -rf /stackable/nifi-${PRODUCT }/docs
90
+ rm -rf /stackable/nifi-${NEW_VERSION }/docs
84
91
85
92
# Set correct permissions
86
93
chmod -R g=u /stackable
@@ -182,15 +189,15 @@ LABEL name="Apache NiFi" \
182
189
summary="The Stackable image for Apache NiFi." \
183
190
description="This image is deployed by the Stackable Operator for Apache NiFi."
184
191
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
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
187
194
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
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/
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/
190
197
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*-src.tar.gz /stackable
191
198
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
192
199
193
- COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/opa-authorizer.nar /stackable/nifi-${PRODUCT}/extensions/opa-authorizer.nar
200
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/opa-authorizer.nar /stackable/nifi-${PRODUCT}-stackable${RELEASE} /extensions/opa-authorizer.nar
194
201
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/nifi-opa-plugin-${NIFI_OPA_AUTHORIZER_PLUGIN}-src.tar.gz /stackable
195
202
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/LICENSE /licenses/NIFI_OPA_PLUGIN_LICENSE
196
203
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin
@@ -219,13 +226,13 @@ pip install --no-cache-dir \
219
226
# This can be removed once older versions / operators using this are no longer supported
220
227
ln -s /stackable/stackable-bcrypt.jar /bin/stackable-bcrypt.jar
221
228
222
- ln -s /stackable/nifi-${PRODUCT} /stackable/nifi
229
+ ln -s /stackable/nifi-${PRODUCT}-stackable${RELEASE} /stackable/nifi
223
230
224
231
# fix missing permissions / ownership
225
232
chown --no-dereference ${STACKABLE_USER_UID}:0 /stackable/nifi
226
233
chmod --recursive g=u /stackable/python
227
234
chmod --recursive g=u /stackable/bin
228
- chmod g=u /stackable/nifi-${PRODUCT}
235
+ chmod g=u /stackable/nifi-${PRODUCT}-stackable${RELEASE}
229
236
chmod g=u /stackable/*-src.tar.gz
230
237
EOF
231
238
0 commit comments