2
2
set -e
3
3
4
4
SOURCEDIR=" $( 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}
5
15
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
6
23
7
24
# # Get OTel version
8
25
echo " Info: Getting OTEL Version"
9
- file=" $SOURCEDIR /../.github/patches/versions"
10
26
version=$( awk -F' =v' ' /OTEL_JAVA_INSTRUMENTATION_VERSION/ {print $2}' " $file " )
11
27
echo " Found OTEL Version: ${version} "
12
28
# Exit if the version is empty or null
@@ -22,6 +38,9 @@ git clone https://github.com/open-telemetry/opentelemetry-java-instrumentation.g
22
38
pushd opentelemetry-java-instrumentation
23
39
git checkout v${version} -b tag-v${version}
24
40
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
+
25
44
# This patch is for Lambda related context propagation
26
45
patch -p1 < " $SOURCEDIR " /patches/opentelemetry-java-instrumentation.patch
27
46
@@ -31,23 +50,6 @@ patch -p1 < "$SOURCEDIR"/patches/StreamHandlerInstrumentation.patch
31
50
popd
32
51
rm -rf opentelemetry-java-instrumentation
33
52
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
-
51
53
# # Build the ADOT Java from current source
52
54
echo " Info: Building ADOT Java from current source"
53
55
pushd " $SOURCEDIR " /..
0 commit comments