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

fix ci script

This commit is contained in:
checktheroads
2020-02-23 10:33:14 -07:00
parent 24da166d62
commit 5c09bcf0f2
2 changed files with 10 additions and 35 deletions

View File

@@ -1,8 +1,4 @@
#!/bin/sh -l
get_status () {
echo $(curl -s -o /dev/null -w "%{http_code}" http://localhost:8001)
}
#!/usr/bin/env bash
echo "[INFO] Starting Redis..."
redis-server &
@@ -14,6 +10,8 @@ poetry run hyperglass setup -d
echo "[SUCCESS] Setup completed."
sleep 2
echo "listen_address: 127.0.0.1" >> /root/hyperglass/hyperglass.yaml
echo "[INFO] Starting UI build."
poetry run hyperglass build-ui
echo "[SUCCESS] UI build completed."
@@ -29,11 +27,17 @@ fi
echo "[SUCCESS] Started hyperglass."
echo "[INFO] Running HTTP test..."
echo "[INFO] Status code: $(get_status)"
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8001)
echo "[INFO] Status code: $STATUS"
if [[ ! $? == 0 ]]; then
echo "[ERROR] HTTP test failed."
exit 1
elif [[ ! "$STATUS" == "200" ]]; then
echo "[ERROR] HTTP test failed."
exit 1
fi
echo "[SUCCESS] Tests ran successfully."