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

test travis

This commit is contained in:
checktheroads
2020-02-21 22:52:42 -07:00
parent ceb5e46fc9
commit 6f205f0143
5 changed files with 51 additions and 55 deletions

View File

@@ -1,26 +0,0 @@
version: 2.1
jobs:
build:
docker:
- image: ../.tests/DockerfileUbuntu
steps:
- run:
name: Setup
command: |
redis-server &
cd /tmp/hyperglass
poetry run hyperglass setup -d
poetry run hyperglass build-ui
- run:
name: Set listen_address
command: |
echo "listen_address: 127.0.0.1" >> /root/hyperglass/hyperglass.yaml
- run:
name: Start
command: |
poetry run hyperglass start &> /var/log/hyperglassci.log &
sleep 10
- run:
name: Test
command: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:8001

View File

@@ -1,29 +1,29 @@
name: Run Tests # name: Run Tests
on: # on:
push: # push:
branches: # branches:
- v1.0.0 # - v1.0.0
jobs: # jobs:
build: # build:
runs-on: ubuntu-18.04 # runs-on: ubuntu-18.04
services: # services:
redis: # redis:
image: redis # image: redis
ports: # ports:
- 6379:6379 # - 6379:6379
steps: # steps:
- name: Setup Python 3.6 # - name: Setup Python 3.6
uses: actions/setup-python@v1 # uses: actions/setup-python@v1
with: # with:
python-version: 3.6.10 # python-version: 3.6.10
- name: Clone Repository # - name: Clone Repository
uses: actions/checkout@v2 # uses: actions/checkout@v2
with: # with:
ref: v1.0.0 # ref: v1.0.0
- name: Install Poetry # - name: Install Poetry
uses: dschep/install-poetry-action@v1.3 # uses: dschep/install-poetry-action@v1.3
- name: Install Python Dependencies # - name: Install Python Dependencies
run: poetry install # run: poetry install
- name: Lint # - name: Lint
run: poetry run flake8 hyperglass # run: poetry run flake8 hyperglass

View File

@@ -22,4 +22,3 @@ FROM base as install
WORKDIR /tmp/hyperglass WORKDIR /tmp/hyperglass
RUN poetry install --no-ansi RUN poetry install --no-ansi
COPY ./dockersetup.sh /dockersetup.sh COPY ./dockersetup.sh /dockersetup.sh
ENTRYPOINT ["/dockersetup.sh"]

13
.tests/dockersetup.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh -l
cd /tmp/hyperglass
echo "Starting setup..."
poetry run hyperglass setup -d
echo "Setup completed"
sleep 2
echo "Starting UI build"
poetry run hyperglass build-ui
echo "UI build completed"
# echo "Starting redis..."
# redis-server &
# echo "Redis started"
echo ""

10
.travis.yml Normal file
View File

@@ -0,0 +1,10 @@
---
language: minimal
services:
- docker
- redis
before_install:
- docker build -t hyperglass/ubuntu -f ./tests/DockerfileUbuntu .
script:
- bash /tmp/dockersetup.sh