diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index a0571f4..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,41 +0,0 @@ -repos: - - repo: https://github.com/pycqa/isort - rev: 5.11.2 - hooks: - - id: isort - args: ['--profile', 'black', '--filter-files', '--check'] - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.261 - hooks: - - id: ruff - # Respect `exclude` and `extend-exclude` settings. - - repo: local - hooks: - - id: typescript - name: TypeScript - files: 'hyperglass/ui/*' - exclude: 'hyperglass/ui/node_modules|hyperglass/ui/.next' - stages: - - commit - entry: ./.tests/pre-commit-frontend.sh --typescript - language: script - - repo: local - hooks: - - id: eslint - name: ESLint - files: 'hyperglass/ui/*' - exclude: 'hyperglass/ui/node_modules|hyperglass/ui/.next' - stages: - - commit - entry: ./.tests/pre-commit-frontend.sh --eslint - language: script - - repo: local - hooks: - - id: prettier - name: Prettier - files: 'hyperglass/ui/*' - exclude: 'hyperglass/ui/node_modules|hyperglass/ui/.next' - stages: - - commit - entry: ./.tests/pre-commit-frontend.sh --prettier - language: script diff --git a/.tests/app/setup.sh b/.tests/app/setup.sh deleted file mode 100755 index 4f4cc87..0000000 --- a/.tests/app/setup.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -echo "[INFO] Starting Redis..." -redis-server & - -cd /tmp/hyperglass - -echo "[INFO] Starting setup..." -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 - -if [[ ! $? == 0 ]]; then - echo "[ERROR] Failed to start hyperglass." - exit 1 -else - echo "[SUCCESS] UI build completed." -fi - -echo "[INFO] Starting hyperglass..." -poetry run hyperglass start &> /var/log/hyperglassci.log & -sleep 180 - -if [[ ! $? == 0 ]]; then - echo "[ERROR] Failed to start hyperglass." - exit 1 -else - echo "[SUCCESS] Started hyperglass." -fi - -echo "[INFO] Running HTTP test..." - -STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1: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. Startup log:" - cat /var/log/hyperglassci.log - exit 1 -fi - -echo "[SUCCESS] Tests ran successfully." -exit 0 \ No newline at end of file diff --git a/.tests/app/ubuntu/Dockerfile b/.tests/app/ubuntu/Dockerfile deleted file mode 100644 index 73bd15e..0000000 --- a/.tests/app/ubuntu/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM ubuntu:bionic as base -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -WORKDIR /tmp -RUN apt-get update \ - && apt-get install -y git curl net-tools \ - && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && apt-get update \ - && apt-get install -y python3 python3-pip python3-venv redis-server nodejs yarn \ - # && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 \ - # - # Pinning Poetry installer to this specific version. As of 2020 07 24, the script from master - # fails to install due to Python 2's executable matching first. See #2106 - # - && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/e70ee3112ab06374dfef4ab84e6dded2382cc7dd/get-poetry.py | python3 \ - && python3 --version \ - && echo "NodeJS $(node --version)" \ - && echo "Yarn $(yarn --version)" -COPY ./ /tmp/hyperglass -ENV PATH=$PATH:/root/.poetry/bin - -FROM base as install -WORKDIR /tmp/hyperglass -RUN poetry install --no-ansi - -FROM install as setup -WORKDIR /tmp/hyperglass -COPY .tests/app/setup.sh /tmp/setup.sh -RUN ls -lsah /tmp \ No newline at end of file diff --git a/.tests/install/ubuntu/Dockerfile b/.tests/install/ubuntu/Dockerfile deleted file mode 100644 index 2afb057..0000000 --- a/.tests/install/ubuntu/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:bionic as base -WORKDIR /tmp -COPY .tests/install/ubuntu/setup.sh /tmp/init.sh -COPY ./install.sh /tmp/install.sh -RUN bash /tmp/init.sh \ No newline at end of file diff --git a/.tests/install/ubuntu/setup.sh b/.tests/install/ubuntu/setup.sh deleted file mode 100755 index 23b9fbe..0000000 --- a/.tests/install/ubuntu/setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -echo "[INFO] Disabling multiverse repos..." -sed -i -e '/multiverse/s/^#*/#\ /g' /etc/apt/sources.list -cat /etc/apt/sources.list - -echo "[INFO] Updating package repos..." -apt-get update &> /dev/null - -echo "[INFO] Installing apt-utils..." -apt-get install -y apt-utils > /dev/null - -echo "[INFO] Installing base dependencies..." -apt-get install -y curl git gnupg dialog build-essential > /dev/null - -echo '[SUCCESS] Completed build' -exit 0 \ No newline at end of file diff --git a/.tests/pre-commit-frontend.sh b/.tests/pre-commit-frontend.sh deleted file mode 100755 index 3c5f001..0000000 --- a/.tests/pre-commit-frontend.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -UI_DIR="$(pwd)/hyperglass/ui" - -check_typescript() { - yarn --cwd $UI_DIR typecheck -} - -check_eslint() { - yarn --cwd $UI_DIR lint -} - -check_prettier() { - yarn --cwd $UI_DIR prettier -c . -} - -for arg in "$@"; do - if [ "$arg" == "--typescript" ]; then - check_typescript - exit $? - elif [ "$arg" == "--eslint" ]; then - check_eslint - exit $? - elif [ "$arg" == "--prettier" ]; then - check_prettier - exit $? - else - echo "Arguments --typescript, --eslint, or --prettier required." - exit 1 - fi -done