Skip to content

Commit 3019af4

Browse files
committed
chore: make hadolint happy
1 parent df556a5 commit 3019af4

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

hive/Dockerfile

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,34 @@ WORKDIR /stackable
3232
# Cache mounts are owned by root by default
3333
# We need to explicitly give the uid to use
3434
RUN --mount=type=cache,id=maven-hive-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
35-
cd "$(/stackable/patchable --images-repo-root=src checkout hive ${PRODUCT})"
35+
BUILD_SRC_DIR="$(/stackable/patchable --images-repo-root=src checkout hive ${PRODUCT})"
36+
cd "$BUILD_SRC_DIR"
3637

3738
if [[ "${PRODUCT}" == "3.1.3" ]] ; then
3839
mvn --batch-mode --no-transfer-progress clean package -DskipTests --projects standalone-metastore
3940
mv standalone-metastore/target/apache-hive-metastore-${PRODUCT}-bin/apache-hive-metastore-${PRODUCT}-bin /stackable
4041
mv standalone-metastore/target/bom.json /stackable/apache-hive-metastore-${PRODUCT}-bin/apache-hive-metastore-${PRODUCT}.cdx.json
4142
else
42-
# https://issues.apache.org/jira/browse/HIVE-20451 switched the metastore server packaging starting with 4.0.0
43-
cd standalone-metastore
44-
mvn --batch-mode --no-transfer-progress clean package -DskipTests --projects metastore-server
45-
46-
# We only seem to get a .tar.gz archive, so let's extract that to the correct location
47-
tar --extract --directory=/stackable -f metastore-server/target/apache-hive-standalone-metastore-server-${PRODUCT}-bin.tar.gz
48-
mv metastore-server/target/bom.json /stackable/apache-hive-metastore-${PRODUCT}-bin/apache-hive-metastore-${PRODUCT}.cdx.json
49-
50-
# TODO: Remove once the fix https://github.com/apache/hive/pull/5419 is merged and released
51-
# The schemaTool.sh is still pointing to the class location from Hive < 4.0.0, it seems like it was forgotten to update it
52-
sed -i -e 's/CLASS=org.apache.hadoop.hive.metastore.tools.MetastoreSchemaTool/CLASS=org.apache.hadoop.hive.metastore.tools.schematool.MetastoreSchemaTool/' /stackable/apache-hive-metastore-${PRODUCT}-bin/bin/ext/schemaTool.sh
53-
cd ..
43+
(
44+
# https://issues.apache.org/jira/browse/HIVE-20451 switched the metastore server packaging starting with 4.0.0
45+
cd standalone-metastore
46+
mvn --batch-mode --no-transfer-progress clean package -DskipTests --projects metastore-server
47+
48+
# We only seem to get a .tar.gz archive, so let's extract that to the correct location
49+
tar --extract --directory=/stackable -f metastore-server/target/apache-hive-standalone-metastore-server-${PRODUCT}-bin.tar.gz
50+
mv metastore-server/target/bom.json /stackable/apache-hive-metastore-${PRODUCT}-bin/apache-hive-metastore-${PRODUCT}.cdx.json
51+
52+
# TODO: Remove once the fix https://github.com/apache/hive/pull/5419 is merged and released
53+
# The schemaTool.sh is still pointing to the class location from Hive < 4.0.0, it seems like it was forgotten to update it
54+
sed -i -e 's/CLASS=org.apache.hadoop.hive.metastore.tools.MetastoreSchemaTool/CLASS=org.apache.hadoop.hive.metastore.tools.schematool.MetastoreSchemaTool/' /stackable/apache-hive-metastore-${PRODUCT}-bin/bin/ext/schemaTool.sh
55+
)
5456
fi
5557

56-
cp /stackable/bin/start-metastore /stackable/apache-hive-metastore-${PRODUCT}-bin/bin
57-
5858
# Remove sourcecode
59-
cd ..
60-
rm -rf ./${PRODUCT}
59+
cd /stackable
60+
rm -rf "$BUILD_SRC_DIR"
61+
62+
cp bin/start-metastore apache-hive-metastore-${PRODUCT}-bin/bin
6163

6264
curl "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" -o "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar"
6365
ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar

trino/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ COPY --chown=${STACKABLE_USER_UID}:0 trino/stackable/patches/${PRODUCT} /stackab
1515
# adding a hadolint ignore for SC2215, due to https://github.com/hadolint/hadolint/issues/980
1616
# hadolint ignore=SC2215
1717
RUN --mount=type=cache,id=maven-${PRODUCT},target=/root/.m2/repository <<EOF
18-
cd "$(/stackable/patchable --images-repo-root=src checkout trino ${PRODUCT})"
18+
BUILD_SRC_DIR="$(/stackable/patchable --images-repo-root=src checkout trino ${PRODUCT})"
19+
cd "$BUILD_SRC_DIR"
1920

2021
# Trino is using something (git-commit-id-plugin in the past, maybe something else now) that is
2122
# reading the Git history and searches for a tag to pull the version from. It sounds weird to me
@@ -43,8 +44,8 @@ mv core/trino-server/target/bom.json /stackable/trino-server-${PRODUCT}/trino-se
4344
chown --recursive ${STACKABLE_USER_UID}:0 /stackable/trino-server-${PRODUCT}
4445

4546
# Delete all intermediate build products to free some more space
46-
cd ..
47-
rm -r ./${PRODUCT}
47+
cd /stackable
48+
rm -r "$BUILD_SRC_DIR"
4849
EOF
4950

5051
COPY --from=trino-storage-connector-image /stackable/src/trino-storage-connector/patchable-work/worktree/${PRODUCT}/target/trino-storage-${PRODUCT} /stackable/trino-server-${PRODUCT}/plugin/trino-storage-${PRODUCT}

0 commit comments

Comments
 (0)