forked from CDCgov/prime-simplereport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlighthouse.sh
executable file
·27 lines (22 loc) · 917 Bytes
/
lighthouse.sh
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
#!/bin/bash
echo "Starting docker containers"
docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --quiet-pull
echo "Waiting for backend to start at https://localhost.simplereport.gov/api/actuator/health"
http_response=0
polls=0
while [[ $http_response != *"UP"* && $polls -lt 180 ]]; do
((polls++))
sleep 2
echo "Waiting for backend to start at https://localhost.simplereport.gov/api/actuator/health"
http_response=$(curl -skL -w "%{http_code}" "https://localhost.simplereport.gov/api/actuator/health")
done
if [[ $http_response != *"UP"* ]]; then
echo 'Backend never started. Exiting...'
exit 1
fi
echo 'Backend started!'
echo
FACILITY_ID=$(docker exec db psql -qtA -v ON_ERROR_STOP=1 -p 5432 -U simple_report_migrations simple_report -c "select internal_id from simple_report.facility limit 1;")
echo "Our facility id is: $FACILITY_ID."
npm install -g @lhci/[email protected]
lhci autorun