Skip to content

Commit ca62592

Browse files
committed
browser-emulator: notify aws script should search for the binary first
1 parent e2b2536 commit ca62592

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

browser-emulator/notify-aws.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ set -o xtrace
1010
pip3 install --break-system-packages https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz
1111

1212
# sending the finish call
13-
/home/ubuntu/.local/bin/cfn-signal -e 0 --stack ${AWS_STACK} --resource BrowserInstance --region ${AWS_REGION}
13+
CFN_SIGNAL_BIN="$(command -v cfn-signal || true)"
14+
if [[ -z "${CFN_SIGNAL_BIN}" && -x "/home/ubuntu/.local/bin/cfn-signal" ]]; then
15+
CFN_SIGNAL_BIN="/home/ubuntu/.local/bin/cfn-signal"
16+
fi
17+
18+
if [[ -z "${CFN_SIGNAL_BIN}" ]]; then
19+
echo "cfn-signal binary not found" >&2
20+
exit 1
21+
fi
22+
23+
"${CFN_SIGNAL_BIN}" -e 0 --stack "${AWS_STACK}" --resource BrowserInstance --region "${AWS_REGION}"
1424

1525
echo "Instance is ready"

0 commit comments

Comments
 (0)