Skip to content

Commit 05880b4

Browse files
committed
Fix lambda layer build script
1 parent 5d07e67 commit 05880b4

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

lambda-layer/build-layer.sh

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ set -e
33

44
SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
55

6+
contrib_version=$(awk -F'=v' '/OTEL_JAVA_CONTRIB_VERSION/ {print $2}' "$file")
7+
if [[ -n "$contrib_version" ]]; then
8+
echo "Found OTEL Contrib Version: ${contrib_version}"
9+
## Clone and Patch the OpenTelemetry Java contrib Repository
10+
echo "Info: Cloning and Patching OpenTelemetry Java contrib Repository"
11+
git clone https://github.com/open-telemetry/opentelemetry-java-contrib.git
12+
pushd opentelemetry-java-contrib
13+
git checkout v${contrib_version} -b tag-v${contrib_version}
14+
15+
# There is another patch in the .github/patches directory for other changes. We should apply them too for consistency.
16+
patch -p1 < "$SOURCEDIR"/../.github/patches/opentelemetry-java-contrib.patch
17+
18+
./gradlew publishToMavenLocal
19+
popd
20+
rm -rf opentelemetry-java-contrib
21+
fi
622

723
## Get OTel version
824
echo "Info: Getting OTEL Version"
@@ -34,23 +50,6 @@ patch -p1 < "$SOURCEDIR"/patches/StreamHandlerInstrumentation.patch
3450
popd
3551
rm -rf opentelemetry-java-instrumentation
3652

37-
contrib_version=$(awk -F'=v' '/OTEL_JAVA_CONTRIB_VERSION/ {print $2}' "$file")
38-
if [[ -n "$contrib_version" ]]; then
39-
echo "Found OTEL Contrib Version: ${contrib_version}"
40-
## Clone and Patch the OpenTelemetry Java contrib Repository
41-
echo "Info: Cloning and Patching OpenTelemetry Java contrib Repository"
42-
git clone https://github.com/open-telemetry/opentelemetry-java-contrib.git
43-
pushd opentelemetry-java-contrib
44-
git checkout v${contrib_version} -b tag-v${contrib_version}
45-
46-
# There is another patch in the .github/patches directory for other changes. We should apply them too for consistency.
47-
patch -p1 < "$SOURCEDIR"/../.github/patches/opentelemetry-java-contrib.patch
48-
49-
./gradlew publishToMavenLocal
50-
popd
51-
rm -rf opentelemetry-java-contrib
52-
fi
53-
5453
## Build the ADOT Java from current source
5554
echo "Info: Building ADOT Java from current source"
5655
pushd "$SOURCEDIR"/..

0 commit comments

Comments
 (0)