mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
fix ci script
This commit is contained in:
29
.github/workflows/tests.yml
vendored
29
.github/workflows/tests.yml
vendored
@ -1,29 +0,0 @@
|
||||
# name: Run Tests
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - v1.0.0
|
||||
|
||||
# jobs:
|
||||
# build:
|
||||
# runs-on: ubuntu-18.04
|
||||
# services:
|
||||
# redis:
|
||||
# image: redis
|
||||
# ports:
|
||||
# - 6379:6379
|
||||
# steps:
|
||||
# - name: Setup Python 3.6
|
||||
# uses: actions/setup-python@v1
|
||||
# with:
|
||||
# python-version: 3.6.10
|
||||
# - name: Clone Repository
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# ref: v1.0.0
|
||||
# - name: Install Poetry
|
||||
# uses: dschep/install-poetry-action@v1.3
|
||||
# - name: Install Python Dependencies
|
||||
# run: poetry install
|
||||
# - name: Lint
|
||||
# run: poetry run flake8 hyperglass
|
@ -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."
|
||||
|
Reference in New Issue
Block a user