From 65d2ba29caab9cf834149e55be0e1d6404cf8d8b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 9 May 2024 12:47:39 +0200 Subject: [PATCH 1/2] buildkite: install java earlier --- .buildkite/hooks/pre-command | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 5b42228ea6..bebcced2a4 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -14,6 +14,9 @@ if [[ "$BUILDKITE_COMMAND" =~ .*"upload".* ]]; then exit 0 fi +# Run always +source .buildkite/hooks/prepare-common.sh + if [ "$BUILDKITE_PIPELINE_SLUG" == "apm-agent-java-opentelemetry-benchmark" ]; then source .buildkite/hooks/prepare-benchmark.sh fi @@ -25,6 +28,3 @@ fi if [ "$BUILDKITE_PIPELINE_SLUG" == "apm-agent-java-release" ]; then source .buildkite/hooks/prepare-release.sh fi - -# Run always -source .buildkite/hooks/prepare-common.sh From 4fbe347e38209f5dff5a318a571589bcd1001887 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 9 May 2024 13:36:25 +0200 Subject: [PATCH 2/2] support version 21 for opentelemetry --- .buildkite/hooks/pre-command | 4 ++++ .buildkite/hooks/prepare-common.sh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index bebcced2a4..b8d23cd6fa 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -19,6 +19,10 @@ source .buildkite/hooks/prepare-common.sh if [ "$BUILDKITE_PIPELINE_SLUG" == "apm-agent-java-opentelemetry-benchmark" ]; then source .buildkite/hooks/prepare-benchmark.sh + # NOTE: https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/11323 might + # support .java-version, if so then it might be worthy to read the file. + JAVA_VERSION=21 + source .buildkite/hooks/prepare-common.sh fi if [ "$BUILDKITE_PIPELINE_SLUG" == "apm-agent-java-snapshot" ]; then diff --git a/.buildkite/hooks/prepare-common.sh b/.buildkite/hooks/prepare-common.sh index 7c04356ecf..7697908c6f 100644 --- a/.buildkite/hooks/prepare-common.sh +++ b/.buildkite/hooks/prepare-common.sh @@ -2,7 +2,9 @@ set -eo pipefail # Configure the java version -JAVA_VERSION=$(cat .java-version | xargs | tr -dc '[:print:]') +if [ -z "$JAVA_VERSION" ] ; then + JAVA_VERSION=$(cat .java-version | xargs | tr -dc '[:print:]') +fi set +u # In case the HOME is not available in the context of the runner. if [ -z "${HOME}" ] ; then