Skip to content

Commit 15846b4

Browse files
add ruby and java version in Layer description (#390)
* add ruby & java version in Layer description
1 parent a66325e commit 15846b4

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

libBuild.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,9 @@ function publish_layer {
275275
fi
276276

277277
base_description="New Relic Layer for ${runtime_name} (${arch})"
278-
278+
extension_info=" with New Relic Extension v${EXTENSION_VERSION}"
279+
279280
if [[ $newrelic_agent_version != "none" ]]; then
280-
extension_info=" with New Relic Extension v${EXTENSION_VERSION}"
281-
282281
if [[ $agent_name != "provided" ]]; then
283282
agent_info=" and ${agent_name} agent v${newrelic_agent_version}"
284283
else
@@ -288,7 +287,11 @@ function publish_layer {
288287

289288
description="${base_description}${extension_info}${agent_info}"
290289
else
291-
description="${base_description}."
290+
if [[ $agent_name == "Java" ]]; then
291+
description="${base_description}${extension_info}"
292+
else
293+
description="${base_description}."
294+
fi
292295
fi
293296

294297
echo "Publishing ${runtime_name} layer to ${region}"

ruby/publish-layers.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set -Eeuo pipefail
1717
RUBY_DIR=ruby
1818
DIST_DIR=dist
1919
WRAPPER_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

Comments
 (0)