22set -e
33
44SOURCEDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) "
5+ file=" $SOURCEDIR /../.github/patches/versions"
6+
7+ contrib_version=$( awk -F' =v' ' /OTEL_JAVA_CONTRIB_VERSION/ {print $2}' " $file " )
8+ if [[ -n " $contrib_version " ]]; then
9+ echo " Found OTEL Contrib Version: ${contrib_version} "
10+ # # Clone and Patch the OpenTelemetry Java contrib Repository
11+ echo " Info: Cloning and Patching OpenTelemetry Java contrib Repository"
12+ git clone https://github.com/open-telemetry/opentelemetry-java-contrib.git
13+ pushd opentelemetry-java-contrib
14+ git checkout v${contrib_version} -b tag-v${contrib_version}
515
16+ # There is another patch in the .github/patches directory for other changes. We should apply them too for consistency.
17+ patch -p1 < " $SOURCEDIR " /../.github/patches/opentelemetry-java-contrib.patch
18+
19+ ./gradlew publishToMavenLocal
20+ popd
21+ rm -rf opentelemetry-java-contrib
22+ fi
623
724# # Get OTel version
825echo " Info: Getting OTEL Version"
9- file=" $SOURCEDIR /../.github/patches/versions"
1026version=$( awk -F' =v' ' /OTEL_JAVA_INSTRUMENTATION_VERSION/ {print $2}' " $file " )
1127echo " Found OTEL Version: ${version} "
1228# Exit if the version is empty or null
@@ -22,6 +38,9 @@ git clone https://github.com/open-telemetry/opentelemetry-java-instrumentation.g
2238pushd opentelemetry-java-instrumentation
2339git checkout v${version} -b tag-v${version}
2440
41+ # There is another patch in the .github/patches directory for other changes. We should apply them too for consistency.
42+ patch -p1 < " $SOURCEDIR " /../.github/patches/opentelemetry-java-instrumentation.patch
43+
2544# This patch is for Lambda related context propagation
2645patch -p1 < " $SOURCEDIR " /patches/opentelemetry-java-instrumentation.patch
2746
@@ -31,23 +50,6 @@ patch -p1 < "$SOURCEDIR"/patches/StreamHandlerInstrumentation.patch
3150popd
3251rm -rf opentelemetry-java-instrumentation
3352
34- contrib_version=$( awk -F' =v' ' /OTEL_JAVA_CONTRIB_VERSION/ {print $2}' " $file " )
35- if [[ -n " $contrib_version " ]]; then
36- echo " Found OTEL Contrib Version: ${contrib_version} "
37- # # Clone and Patch the OpenTelemetry Java contrib Repository
38- echo " Info: Cloning and Patching OpenTelemetry Java contrib Repository"
39- git clone https://github.com/open-telemetry/opentelemetry-java-contrib.git
40- pushd opentelemetry-java-contrib
41- git checkout v${contrib_version} -b tag-v${contrib_version}
42-
43- # There is another patch in the .github/patches directory for other changes. We should apply them too for consistency.
44- patch -p1 < " $SOURCEDIR " /../.github/patches/opentelemetry-java-contrib.patch
45-
46- ./gradlew publishToMavenLocal
47- popd
48- rm -rf opentelemetry-java-contrib
49- fi
50-
5153# # Build the ADOT Java from current source
5254echo " Info: Building ADOT Java from current source"
5355pushd " $SOURCEDIR " /..
0 commit comments