Skip to content

Commit b47528b

Browse files
committed
Exit if not found.
1 parent 988f280 commit b47528b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ci/input_files/build.yaml.tpl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,14 @@ publish-layer-{{ $environment_name }} ({{ $runtime.name }}-{{ $runtime.arch }}):
180180
- |
181181
STAGE={{ $environment_name }} PYTHON_VERSION={{ $runtime.python_version }} ARCH={{ $runtime.arch }} ./ci/publish_layers.sh | tee publish.log
182182
# Extract the arn from the publish log to be used as envvar in e2e tests
183-
echo "PYTHON_{{ $runtime.name | strings.Trim "python" }}_VERSION=$(grep 'Published arn' publish.log | grep -oE 'arn:aws:lambda:.*:\d+')" > {{ $dotenv }}
183+
layer_arn="$(grep 'Published arn' publish.log | grep -oE 'arn:aws:lambda:.*:\d+')"
184+
if [ -z "$layer_arn" ]; then
185+
echo "Error: Layer ARN not found in publish log"
186+
exit 1
187+
else
188+
echo "Found layer arn: $layer_arn"
189+
fi
190+
echo "PYTHON_{{ $runtime.name | strings.Trim "python" }}_VERSION=$layer_arn" > {{ $dotenv }}
184191
cat {{ $dotenv }}
185192

186193

0 commit comments

Comments
 (0)