1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

52 lines
1.1 KiB
Bash
Raw Normal View History

2020-02-23 10:33:14 -07:00
#!/usr/bin/env bash
echo "[INFO] Starting Redis..."
redis-server &
2020-02-21 22:52:42 -07:00
cd /tmp/hyperglass
echo "[INFO] Starting setup..."
2020-02-21 22:52:42 -07:00
poetry run hyperglass setup -d
echo "[SUCCESS] Setup completed."
2020-02-21 22:52:42 -07:00
sleep 2
2020-02-23 10:33:14 -07:00
echo "listen_address: 127.0.0.1" >> /root/hyperglass/hyperglass.yaml
echo "[INFO] Starting UI build."
2020-02-21 22:52:42 -07:00
poetry run hyperglass build-ui
2020-02-25 08:19:15 -07:00
if [[ ! $? == 0 ]]; then
echo "[ERROR] Failed to start hyperglass."
exit 1
else
echo "[SUCCESS] UI build completed."
fi
echo "[INFO] Starting hyperglass..."
2020-02-22 00:06:35 -07:00
poetry run hyperglass start &> /var/log/hyperglassci.log &
sleep 180
if [[ ! $? == 0 ]]; then
echo "[ERROR] Failed to start hyperglass."
exit 1
2020-02-25 08:19:15 -07:00
else
echo "[SUCCESS] Started hyperglass."
fi
echo "[INFO] Running HTTP test..."
2020-02-23 10:33:14 -07:00
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8001)
2020-02-23 10:33:14 -07:00
echo "[INFO] Status code: $STATUS"
if [[ ! $? == 0 ]]; then
echo "[ERROR] HTTP test failed."
exit 1
2020-02-23 10:33:14 -07:00
elif [[ ! "$STATUS" == "200" ]]; then
2020-02-25 08:19:15 -07:00
echo "[ERROR] HTTP test failed. Startup log:"
cat /var/log/hyperglassci.log
2020-02-23 10:33:14 -07:00
exit 1
fi
echo "[SUCCESS] Tests ran successfully."
2020-02-22 00:06:35 -07:00
exit 0