-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-deployment.sh
More file actions
executable file
Β·48 lines (37 loc) Β· 977 Bytes
/
test-deployment.sh
File metadata and controls
executable file
Β·48 lines (37 loc) Β· 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Test script to verify deployment setup
set -e
echo "π Testing deployment setup..."
# Check if Node.js is available
echo "β
Checking Node.js version..."
node --version
# Check if bun is available
echo "β
Checking bun version..."
bun --version
# Install dependencies
echo "π¦ Installing dependencies..."
bun install
# Build the static site
echo "π¨ Building static site..."
bun run build
# Test the serve script
echo "π Testing serve script..."
# Start server in background
node serve.js &
SERVER_PID=$!
# Wait a bit for server to start
sleep 2
# Test if server is responding
if curl -s http://localhost:3000/ > /dev/null; then
echo "β
Server is responding correctly"
# Stop the server
kill $SERVER_PID
wait $SERVER_PID 2>/dev/null || true
else
echo "β Server failed to respond"
kill $SERVER_PID 2>/dev/null || true
exit 1
fi
echo "π Deployment setup test completed successfully!"
# Clean up
rm -rf build/