Faas semi worfking
This commit is contained in:
23
faas/examples/hello-world/build.sh
Executable file
23
faas/examples/hello-world/build.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build script for hello-world function
|
||||
|
||||
set -e
|
||||
|
||||
echo "Building hello-world function..."
|
||||
|
||||
# Build the Docker image
|
||||
docker build -t hello-world-function .
|
||||
|
||||
echo "Testing the function locally..."
|
||||
|
||||
# Test without input
|
||||
echo "Test 1: No input"
|
||||
docker run --rm hello-world-function
|
||||
|
||||
echo ""
|
||||
echo "Test 2: With name input"
|
||||
docker run --rm -e FUNCTION_INPUT='{"name": "Alice"}' hello-world-function
|
||||
|
||||
echo ""
|
||||
echo "Function built and tested successfully!"
|
||||
Reference in New Issue
Block a user