@@ -9,6 +9,7 @@ FROM stackable/image/java-devel AS builder
9
9
ARG PRODUCT
10
10
ARG JMX_EXPORTER
11
11
ARG STACKABLE_USER_UID
12
+ ARG RELEASE
12
13
13
14
# Copy patches into the builder
14
15
COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/patches/patchable.toml /stackable/src/zookeeper/stackable/patches/patchable.toml
@@ -23,20 +24,26 @@ WORKDIR /stackable
23
24
RUN <<EOF
24
25
cd "$(/stackable/patchable --images-repo-root=src checkout zookeeper ${PRODUCT})"
25
26
27
+ ORIGINAL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
28
+ NEW_VERSION="${PRODUCT}-stackable${RELEASE}"
29
+
30
+ mvn versions:set -DnewVersion=$NEW_VERSION
31
+
26
32
# Create snapshot of the source code including custom patches
27
- tar -czf /stackable/zookeeper-${PRODUCT }-src.tar.gz .
33
+ tar -czf /stackable/zookeeper-${NEW_VERSION }-src.tar.gz .
28
34
29
35
# Exclude the `zookeeper-client` submodule, this is not needed and has c parts
30
36
# that created all kinds of issues for the build container
31
37
mvn --batch-mode --no-transfer-progress -pl "!zookeeper-client/zookeeper-client-c" clean install checkstyle:check spotbugs:check -DskipTests -Pfull-build
32
38
33
39
# Unpack the archive which contains the build artifacts from above. Remove some
34
40
# unused files to shrink the final image size.
35
- mv zookeeper-assembly/target/apache-zookeeper-${PRODUCT}-bin.tar.gz /stackable
36
- tar -C /stackable -xvzf /stackable/apache-zookeeper-${PRODUCT}-bin.tar.gz
37
- mv zookeeper-assembly/target/bom.json /stackable/apache-zookeeper-${PRODUCT}-bin/apache-zookeeper-${PRODUCT}.cdx.json
38
- rm -rf /stackable/apache-zookeeper-${PRODUCT}-bin/docs
39
- rm /stackable/apache-zookeeper-${PRODUCT}-bin/README_packaging.md
41
+ mv zookeeper-assembly/target/apache-zookeeper-${NEW_VERSION}-bin.tar.gz /stackable
42
+ tar -C /stackable -xvzf /stackable/apache-zookeeper-${NEW_VERSION}-bin.tar.gz
43
+ sed -i "s/${NEW_VERSION}/${ORIGINAL_VERSION}/g" zookeeper-assembly/target/bom.json
44
+ mv zookeeper-assembly/target/bom.json /stackable/apache-zookeeper-${NEW_VERSION}-bin/apache-zookeeper-${NEW_VERSION}.cdx.json
45
+ rm -rf /stackable/apache-zookeeper-${NEW_VERSION}-bin/docs
46
+ rm /stackable/apache-zookeeper-${NEW_VERSION}-bin/README_packaging.md
40
47
41
48
# Download the JMX exporter jar from our own repo
42
49
curl "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" \
@@ -70,8 +77,8 @@ LABEL \
70
77
description="This image is deployed by the Stackable Operator for Apache ZooKeeper."
71
78
72
79
# Copy over the ZooKeeper binary folder
73
- COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/apache-zookeeper-${PRODUCT}-bin/
74
- COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/zookeeper-${PRODUCT}-src.tar.gz /stackable
80
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT}-stackable${RELEASE}- bin /stackable/apache-zookeeper-${PRODUCT}-stackable${RELEASE }-bin/
81
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/zookeeper-${PRODUCT}-stackable${RELEASE}- src.tar.gz /stackable
75
82
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/
76
83
COPY zookeeper/licenses /licenses
77
84
@@ -83,14 +90,14 @@ chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt
83
90
chmod g=u /stackable/package_manifest.txt
84
91
rm -rf /var/cache/yum
85
92
86
- # Add link pointing from /stackable/zookeeper to /stackable/apache-zookeeper-${PRODUCT}-bin/
93
+ # Add link pointing from /stackable/zookeeper to /stackable/apache-zookeeper-${PRODUCT}-stackable${RELEASE}- bin/
87
94
# to preserve the folder name with the version.
88
- ln -s /stackable/apache-zookeeper-${PRODUCT}-bin/ /stackable/zookeeper
95
+ ln -s /stackable/apache-zookeeper-${PRODUCT}-stackable${RELEASE}- bin/ /stackable/zookeeper
89
96
chown -h ${STACKABLE_USER_UID}:0 /stackable/zookeeper
90
97
91
98
# fix missing permissions
92
99
chmod g=u /stackable/jmx
93
- chmod g=u /stackable/apache-zookeeper-${PRODUCT}-bin/
100
+ chmod g=u /stackable/apache-zookeeper-${PRODUCT}-stackable${RELEASE}- bin/
94
101
EOF
95
102
96
103
# ----------------------------------------
0 commit comments