Skip to content

Commit 59aebe1

Browse files
Create build.sh
1 parent 11143d7 commit 59aebe1

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

build.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
README_URL="https://github.com/oracle-quickstart/db-endpoint-latency-testing-ammeter/blob/main/README.md"
4+
5+
set -e
6+
7+
echo "🔧 [1/4] Creating Python virtual environment (.venv)..."
8+
if python3 -m venv .venv; then
9+
echo "✅ Virtual environment created."
10+
else
11+
echo "❌ Failed to create venv. Please check your Python installation."
12+
echo "Refer to manual setup: $README_URL"
13+
exit 1
14+
fi
15+
16+
echo "🔧 [2/4] Activating virtual environment..."
17+
# shellcheck source=/dev/null
18+
if source .venv/bin/activate 2>/dev/null; then
19+
echo "✅ Virtual environment activated."
20+
else
21+
echo "❌ Failed to activate virtual environment."
22+
echo "Refer to manual setup: $README_URL"
23+
exit 1
24+
fi
25+
26+
echo "🔧 [3/4] Installing requirements from requirements.txt..."
27+
if pip install --upgrade pip > /dev/null 2>&1 && pip install -r requirements.txt; then
28+
echo "✅ Dependencies installed."
29+
else
30+
echo "❌ Failed to install dependencies."
31+
echo "Refer to manual setup: $README_URL"
32+
exit 1
33+
fi
34+
35+
echo "🚦 [4/4] Launching app with uvicorn (running at http://localhost:8000)..."
36+
if uvicorn app.main:app --host 0.0.0.0 --port 8000
37+
then
38+
echo "✅ App launched."
39+
else
40+
echo "❌ Failed to launch the app. Please check above for errors."
41+
echo "Refer to manual setup: $README_URL"
42+
exit 1
43+
fi

0 commit comments

Comments
 (0)