| name | build-and-test |
| description | Build odin-scout-ent, run it locally, and test APIs. Use when the user asks to build the project, run it, test endpoints, restart the server, or verify changes work. |
Build and Test
Quick Reference
| Task | Command |
|---|
| Build only | if [ -f "pom.xml" ]; then mvn clean package -DskipTests; else (cd odin-scout-ent && mvn clean package -DskipTests); fi |
| Run OAM + Scout | if [ -f "run-both-local.sh" ]; then ./run-both-local.sh; else (cd .. && ./run-both-local.sh); fi |
| Run OAM only | if [ -f "odin-account-manager-ent/run-local.sh" ]; then (cd odin-account-manager-ent && ./run-local.sh); else (cd ../odin-account-manager-ent && ./run-local.sh); fi |
Always use run-both-local.sh to start services. It starts OAM first, then Scout. It is idempotent (skips a service if already running).
Full Workflow
Step 1: Build
if [ -f "pom.xml" ]; then
mvn clean package -DskipTests
elif [ -d "odin-scout-ent" ]; then
(cd odin-scout-ent && mvn clean package -DskipTests)
else
echo "Could not locate odin-scout-ent from current directory."
exit 1
fi
Verify: look for BUILD SUCCESS.
Step 2: Run
if [ -f "run-both-local.sh" ]; then
./run-both-local.sh
else
(cd .. && ./run-both-local.sh)
fi
Verify: OAM on port 9006, Scout on port 8080. Check curl http://localhost:8080/healthcheck.
Step 3: Test APIs
Use the existing test scripts:
./run-network-apis.sh
./run-ecr-get-apis.sh
./run-kubernetes-apis.sh
./run-vm-apis.sh
./run-rds-apis.sh
Or test individual endpoints with curl:
curl -s http://localhost:8080/health | jq .
Step 4: Iterate
After code changes:
- Stop the running servers (Ctrl+C or kill the processes on ports 8080/9006)
- Rebuild:
if [ -f "pom.xml" ]; then mvn clean package -DskipTests; else (cd odin-scout-ent && mvn clean package -DskipTests); fi
- Restart:
if [ -f "run-both-local.sh" ]; then ./run-both-local.sh; else (cd .. && ./run-both-local.sh); fi
- Re-test
Troubleshooting
| Problem | Fix |
|---|
| Port 8080 in use | lsof -i :8080 and kill the process |
| AWS credentials expired | aws sso login --profile central |
| OAM connection refused | Use run-both-local.sh which starts OAM automatically |
| Java version mismatch | Ensure JAVA_HOME points to Java 21 |