forked from andrewpatto/aws-lambda-rust-runtime-old
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-rie.sh
More file actions
executable file
·22 lines (17 loc) · 744 Bytes
/
Copy pathtest-rie.sh
File metadata and controls
executable file
·22 lines (17 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -euo pipefail
EXAMPLE=${1:-basic-lambda}
echo "Building Docker image with RIE for example: $EXAMPLE..."
docker build -f Dockerfile.rie --build-arg EXAMPLE=$EXAMPLE -t rust-lambda-rie-test .
echo "Starting RIE container on port 9000..."
docker run -p 9000:8080 rust-lambda-rie-test &
CONTAINER_PID=$!
echo "Container started. Test with:"
if [ "$EXAMPLE" = "basic-lambda" ]; then
echo "curl -XPOST 'http://localhost:9000/2015-03-31/functions/function/invocations' -d '{\"command\": \"test from RIE\"}' -H 'Content-Type: application/json'"
else
echo "For example '$EXAMPLE', check examples/$EXAMPLE/src/main.rs for the expected payload format."
fi
echo ""
echo "Press Ctrl+C to stop the container."
wait $CONTAINER_PID