Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dev-support/create-release/do-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ if [ "$RUNNING_IN_DOCKER" = "1" ]; then
export PATH="$JAVA_HOME/bin:$PATH"
else
# JAVA_HOME for the openjdk package.
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
arch=`uname -m | sed -e s/aarch64/arm64/ | sed -e s/x86_64/amd64/`
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${arch}/
fi
else
# Outside docker, need to ask for information about the release.
Expand Down
2 changes: 1 addition & 1 deletion dev-support/create-release/hbase-rm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#
# This is all in a single "RUN" command so that if anything changes, "apt update" is run to fetch
# the most current package versions (instead of potentially using old versions cached by docker).
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y update \

Check failure on line 28 in dev-support/create-release/hbase-rm/Dockerfile

View workflow job for this annotation

GitHub Actions / general-check

hadolint: SC2006 style: Use $(...) notation instead of legacy backticks `...`.

Check failure on line 28 in dev-support/create-release/hbase-rm/Dockerfile

View workflow job for this annotation

GitHub Actions / general-check

hadolint: DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
&& DEBIAN_FRONTEND=noninteractive apt-get -qq -y install --no-install-recommends \
curl='7.81.0-*' \
git='1:2.34.1-*' \
Expand All @@ -42,7 +42,7 @@
patch='2.7.6-*' \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java \
&& update-alternatives --set java /usr/lib/jvm/java-8-openjdk-`uname -m | sed -e s/aarch64/arm64/ | sed -e s/x86_64/amd64/`/jre/bin/java \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify the architecture mapping and add a safety check for the Java path? Splitting this into two steps makes it more readable and prevents the script from failing silently if the directory is missing.
e.g. something like below.
arch=$(uname -m | sed -e 's/aarch64/arm64/' -e 's/x86_64/amd64/')
java_bin="/usr/lib/jvm/java-8-openjdk-${arch}/jre/bin/java"

Also, we should add a check (or at least a comment) to verify that the path /usr/lib/jvm/java-8-openjdk-${arch}/... exists, as we're currently assuming it’s always present.

&& pip3 install --no-cache-dir python-dateutil==2.8.2

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down
Loading