Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildkite: fallback if home is not available #3591

Merged
merged 5 commits into from
Apr 22, 2024
Merged
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
10 changes: 9 additions & 1 deletion .buildkite/hooks/prepare-common.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
set -eo pipefail

# Configure the java version
JAVA_VERSION=$(cat .java-version | xargs | tr -dc '[:print:]')
set +u
v1v marked this conversation as resolved.
Show resolved Hide resolved
v1v marked this conversation as resolved.
Show resolved Hide resolved
# In case the HOME is not available in the context of the runner.
if [ -z "${HOME}" ] ; then
HOME="${BUILDKITE_BUILD_CHECKOUT_PATH}"
export HOME
fi
JAVA_HOME="${HOME}/.java/openjdk${JAVA_VERSION}"
set -u

export JAVA_HOME
PATH="${JAVA_HOME}/bin:${PATH}"
export PATH
Expand Down
Loading