@@ -17,6 +17,7 @@ set -Eeuo pipefail
1717RUBY_DIR=ruby
1818DIST_DIR=dist
1919WRAPPER_FILE=newrelic_lambda_wrapper.rb
20+ NEWRELIC_AGENT_VERSION=" "
2021# Set this to a path to a clone of newrelic-lambda-extension to build
2122# an extension from scratch instead of downloading one. Set the path to ''
2223# to simply download a prebuilt one.
@@ -156,10 +157,10 @@ function build_ruby_for_arch {
156157 # The ruby agent version is part of the directory name, e.g., "newrelic_rpm-X.Y.Z"
157158 local agent_dir=$( find $base_dir /gems -type d -name " newrelic_rpm-*" | head -n 1)
158159 if [ -n " $agent_dir " ]; then
159- local agent_version =$( basename " $agent_dir " | cut -d' -' -f2-)
160- echo " $agent_version " > version.txt
160+ NEWRELIC_AGENT_VERSION =$( basename " $agent_dir " | cut -d' -' -f2-)
161+ echo " $NEWRELIC_AGENT_VERSION " > version.txt
161162 cp version.txt $RUBY_DIR /version.txt
162- echo " Succesfully wrote New Relic Ruby Agent version: $agent_version to path $RUBY_DIR /version.txt"
163+ echo " Succesfully wrote New Relic Ruby Agent version: $NEWRELIC_AGENT_VERSION to path $RUBY_DIR /version.txt"
163164 else
164165 echo " Could not find newrelic_rpm gem directory."
165166 fi
@@ -176,7 +177,7 @@ function publish_ruby_for_arch {
176177
177178 for region in " ${REGIONS[@]} " ; do
178179 echo " Publishing $dist_file for region=$region , ruby=$ruby_version , arch=$arch "
179- publish_layer $dist_file $region " ruby${ruby_version} " $arch
180+ publish_layer $dist_file $region " ruby${ruby_version} " $arch $NEWRELIC_AGENT_VERSION
180181 done
181182 echo ' Publishing complete'
182183}
0 commit comments