Skip to content

Commit 1652613

Browse files
committed
revert some unrelated changes
1 parent 4401d6a commit 1652613

2 files changed

Lines changed: 12 additions & 48 deletions

File tree

scripts/build_layers.sh

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@
66
# Copyright 2019 Datadog, Inc.
77

88
# Builds Datadog node layers for lambda functions, using Docker
9-
#
10-
# Usage:
11-
# NODE_VERSION=20.19 ./scripts/build_layers.sh
12-
#
13-
# dd-trace-js overrides (highest priority first):
14-
# DD_TRACE_PACKAGE Exact package spec to use for dd-trace.
15-
# DD_TRACE_COMMIT Specific dd-trace-js commit SHA to build from GitHub.
16-
# DD_TRACE_COMMIT_BRANCH dd-trace-js branch name to build from GitHub.
17-
#
18-
# Examples:
19-
# # Build a single layer for Node 20
20-
# NODE_VERSION=20.19 ./scripts/build_layers.sh
21-
#
22-
# # Build a single layer with dd-trace from a branch
23-
# DD_TRACE_COMMIT_BRANCH=joey/cross-invocation-tracecontext-propagation NODE_VERSION=20.19 ./scripts/build_layers.sh
249
set -e
2510

2611
LAYER_DIR=".layers"
@@ -42,21 +27,6 @@ else
4227
fi
4328
fi
4429

45-
function resolve_dd_trace_package {
46-
if [ -n "$DD_TRACE_PACKAGE" ]; then
47-
echo "$DD_TRACE_PACKAGE"
48-
elif [ -n "$DD_TRACE_COMMIT" ]; then
49-
echo "git+https://github.com/DataDog/dd-trace-js.git#$DD_TRACE_COMMIT"
50-
elif [ -n "$DD_TRACE_COMMIT_BRANCH" ]; then
51-
echo "git+https://github.com/DataDog/dd-trace-js.git#$DD_TRACE_COMMIT_BRANCH"
52-
fi
53-
}
54-
55-
DD_TRACE_PACKAGE_SPEC=$(resolve_dd_trace_package)
56-
if [ -n "$DD_TRACE_PACKAGE_SPEC" ]; then
57-
echo "Using dd-trace package spec: $DD_TRACE_PACKAGE_SPEC"
58-
fi
59-
6030
function make_path_absolute {
6131
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
6232
}
@@ -70,9 +40,7 @@ function docker_build_zip {
7040
# between different node runtimes.
7141
temp_dir=$(mktemp -d)
7242
docker buildx build -t datadog-lambda-layer-node:$1 . --no-cache \
73-
--build-arg image=registry.ddbuild.io/images/mirror/node:${node_image_version}-bullseye \
74-
--build-arg dd_trace_package="$DD_TRACE_PACKAGE_SPEC" \
75-
--progress=plain -o $temp_dir/nodejs
43+
--build-arg image=registry.ddbuild.io/images/mirror/node:${node_image_version}-bullseye --progress=plain -o $temp_dir/nodejs
7644

7745
# Zip to destination, and keep directory structure as based in $temp_dir
7846
(cd $temp_dir && zip -q -r $destination ./)
@@ -92,4 +60,4 @@ do
9260
done
9361

9462
echo "Done creating layers:"
95-
ls $LAYER_DIR | xargs -I _ echo "$LAYER_DIR/_"
63+
ls $LAYER_DIR | xargs -I _ echo "$LAYER_DIR/_"

scripts/publish_layers.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ if [[ ${#LAYER_PATHS[@]} -ne $expected_length ]] || \
3131
exit 1
3232
fi
3333

34+
# Check that the layer files exist
35+
for layer_file in "${LAYER_PATHS[@]}"
36+
do
37+
if [ ! -f $layer_file ]; then
38+
echo "Could not find $layer_file."
39+
exit 1
40+
fi
41+
done
42+
3443
# Determine the target regions
3544
if [ -z "$REGIONS" ]; then
3645
echo "Region not specified, running for all available regions."
@@ -69,19 +78,6 @@ else
6978
echo "Layer version specified: $VERSION"
7079
fi
7180

72-
# Check that the layer files exist for the layers we'll actually publish
73-
for layer_name in "${LAYERS[@]}"; do
74-
for i in "${!AVAILABLE_LAYERS[@]}"; do
75-
if [[ "${AVAILABLE_LAYERS[$i]}" = "${layer_name}" ]]; then
76-
layer_file="${LAYER_PATHS[$i]}"
77-
if [ ! -f "$layer_file" ]; then
78-
echo "Could not find $layer_file."
79-
exit 1
80-
fi
81-
fi
82-
done
83-
done
84-
8581
read -p "Ready to publish version $VERSION of layers ${LAYERS[*]} to regions ${REGIONS[*]} (y/n)?" CONT
8682
if [ "$CONT" != "y" ]; then
8783
echo "Exiting"
@@ -172,4 +168,4 @@ do
172168
done
173169
done
174170
wait_for_processes
175-
echo "Done !"
171+
echo "Done !"

0 commit comments

Comments
 (0)