Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/build_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ function find_and_spec_wheel {
# Restore pyproject.toml to a clean state for each build iteration
cp pyproject.toml.bak pyproject.toml

# Replace ddtrace source if necessary
# Source checkouts still publish project metadata as "ddtrace", even when
# this function is called while probing for ddtrace_serverless wheels.
if [ -n "$DD_TRACE_COMMIT" ]; then
replace_ddtrace_dep "${wheel_basename} = { git = \"https://github.com/DataDog/dd-trace-py.git\", rev = \"$DD_TRACE_COMMIT\" }"
replace_ddtrace_dep "ddtrace = { git = \"https://github.com/DataDog/dd-trace-py.git\", rev = \"$DD_TRACE_COMMIT\" }"
elif [ -n "$DD_TRACE_COMMIT_BRANCH" ]; then
replace_ddtrace_dep "${wheel_basename} = { git = \"https://github.com/DataDog/dd-trace-py.git\", branch = \"$DD_TRACE_COMMIT_BRANCH\" }"
replace_ddtrace_dep "ddtrace = { git = \"https://github.com/DataDog/dd-trace-py.git\", branch = \"$DD_TRACE_COMMIT_BRANCH\" }"
elif [ -n "$DD_TRACE_WHEEL" ]; then
wheel_basename=$(sed 's/^.*\///' <<< ${DD_TRACE_WHEEL%%-*})
replace_ddtrace_dep "${wheel_basename} = { file = \"$DD_TRACE_WHEEL\" }"
Expand Down
22 changes: 13 additions & 9 deletions scripts/publish_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ PIDS=()
# Makes sure any subprocesses will be terminated with this process
trap "pkill -P $$; exit 1;" INT

# Check that the layer files exist
for layer_file in "${LAYER_PATHS[@]}"
do
if [ ! -f $layer_file ]; then
echo "Could not find $layer_file."
exit 1
fi
done

# Determine the target regions
if [ -z "$REGIONS" ]; then
echo "Region not specified, running for all available regions."
Expand Down Expand Up @@ -116,6 +107,19 @@ else
echo "Layer version specified: $VERSION"
fi

# Check that the layer files exist for the layers we'll actually publish
for layer_name in "${LAYERS[@]}"; do
for i in "${!AVAILABLE_LAYERS[@]}"; do
if [[ "${AVAILABLE_LAYERS[$i]}" = "${layer_name}" ]]; then
layer_file="${LAYER_PATHS[$i]}"
if [ ! -f "$layer_file" ]; then
echo "Could not find $layer_file."
exit 1
fi
fi
done
done

read -p "Ready to publish version $VERSION of layers ${LAYERS[*]} to regions ${REGIONS[*]} (y/n)?" CONT
if [ "$CONT" != "y" ]; then
echo "Exiting"
Expand Down
Loading