forked from mirrors/thatmattlove-hyperglass
Start CI rework
This commit is contained in:
parent
889e44d6b1
commit
383494b8ef
8 changed files with 59 additions and 106 deletions
12
.github/workflows/backend.yml
vendored
12
.github/workflows/backend.yml
vendored
|
|
@ -1,5 +1,7 @@
|
|||
name: Backend Testing
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
backend:
|
||||
|
|
@ -9,9 +11,9 @@ jobs:
|
|||
matrix:
|
||||
node-version: [14.x]
|
||||
redis-version: [5, 6]
|
||||
poetry-version: [1.1.4]
|
||||
python-version: [3.6, 3.8]
|
||||
os: [ubuntu-20.04]
|
||||
poetry-version: [1.1.11]
|
||||
python-version: [3.8, 3.9]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
|
|
@ -29,7 +31,7 @@ jobs:
|
|||
poetry-version: ${{ matrix.poetry-version }}
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
|
|
|
|||
21
.github/workflows/frontend.yml
vendored
21
.github/workflows/frontend.yml
vendored
|
|
@ -1,5 +1,7 @@
|
|||
name: Frontend Testing
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
frontend:
|
||||
|
|
@ -8,7 +10,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
os: [ubuntu-20.04]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
working-directory: ./hyperglass/ui
|
||||
|
|
@ -25,11 +27,14 @@ jobs:
|
|||
working-directory: ${{ env.working-directory }}
|
||||
run: yarn install
|
||||
|
||||
- name: TypeScript
|
||||
run: ./.tests/pre-commit-frontend.sh --typescript
|
||||
- name: Formatting (Prettier)
|
||||
run: yarn format:check
|
||||
|
||||
- name: ESLint
|
||||
run: ./.tests/pre-commit-frontend.sh --eslint
|
||||
- name: Lint (ESLint)
|
||||
run: yarn lint
|
||||
|
||||
- name: Prettier
|
||||
run: ./.tests/pre-commit-frontend.sh --prettier
|
||||
- name: Types (TypeScript)
|
||||
run: yarn typecheck
|
||||
|
||||
- name: Tests (Jest)
|
||||
run: yarn test
|
||||
|
|
|
|||
8
.github/workflows/installer.yml
vendored
8
.github/workflows/installer.yml
vendored
|
|
@ -1,5 +1,7 @@
|
|||
name: Installer Testing
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
installer:
|
||||
|
|
@ -7,7 +9,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
|
|
@ -15,4 +17,4 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run hyperglass
|
||||
run: "sudo bash ./install.sh"
|
||||
run: 'sudo bash ./install.sh'
|
||||
|
|
|
|||
|
|
@ -6,18 +6,21 @@ export POETRY_HYPERGLASS_UI_BUILD_TIMEOUT="600"
|
|||
echo "[INFO] Set build timeout to $POETRY_HYPERGLASS_UI_BUILD_TIMEOUT seconds"
|
||||
|
||||
echo "[INFO] Starting setup..."
|
||||
poetry run hyperglass setup -d &> $LOG_FILE
|
||||
poetry run hyperglass setup -d &>$LOG_FILE
|
||||
echo "[SUCCESS] Setup completed."
|
||||
sleep 2
|
||||
|
||||
echo "[INFO] Copying directives.yaml file..."
|
||||
cp ./hyperglass/examples/directives.yaml $HOME/hyperglass/directives.yaml
|
||||
|
||||
echo "[INFO] Copying devices.yaml file..."
|
||||
cp ./hyperglass/examples/devices.yaml $HOME/hyperglass/devices.yaml
|
||||
|
||||
echo "[INFO] Setting listen_address..."
|
||||
echo "listen_address: 127.0.0.1" >> $HOME/hyperglass/hyperglass.yaml
|
||||
echo "listen_address: 127.0.0.1" >>$HOME/hyperglass/hyperglass.yaml
|
||||
|
||||
echo "[INFO] Starting UI build."
|
||||
poetry run hyperglass build-ui &> $LOG_FILE
|
||||
poetry run hyperglass build-ui &>$LOG_FILE
|
||||
|
||||
if [[ ! $? == 0 ]]; then
|
||||
echo "[ERROR] Failed to build hyperglass ui."
|
||||
|
|
@ -29,7 +32,7 @@ else
|
|||
fi
|
||||
|
||||
echo "[INFO] Starting hyperglass..."
|
||||
poetry run hyperglass start &> $LOG_FILE &
|
||||
poetry run hyperglass start &>$LOG_FILE &
|
||||
sleep 120
|
||||
|
||||
if [[ ! $? == 0 ]]; then
|
||||
|
|
|
|||
|
|
@ -1,89 +1,12 @@
|
|||
---
|
||||
routers:
|
||||
- name: sfo_router01
|
||||
address: 10.0.0.1
|
||||
network:
|
||||
name: primary
|
||||
display_name: Main Network
|
||||
- name: Example Device
|
||||
address: 127.0.0.1
|
||||
group: Test
|
||||
credential:
|
||||
username: user1
|
||||
password: secret1
|
||||
display_name: San Francisco, CA
|
||||
port: 22
|
||||
nos: cisco_ios
|
||||
vrfs:
|
||||
- name: default
|
||||
display_name: Global
|
||||
ipv4:
|
||||
source_address: 192.0.2.1
|
||||
access_list:
|
||||
- network: 10.0.0.0/8
|
||||
action: deny
|
||||
- network: 192.168.0.0/16
|
||||
action: deny
|
||||
- network: 172.16.0.0/12
|
||||
action: deny
|
||||
- network: 0.0.0.0/0
|
||||
action: permit
|
||||
ge: 8
|
||||
le: 24
|
||||
ipv6:
|
||||
source_address: 2001:db8::1
|
||||
access_list:
|
||||
- network: ::/0
|
||||
action: permit
|
||||
ge: 32
|
||||
le: 64
|
||||
- name: customer_a
|
||||
display_name: Customer A
|
||||
ipv4:
|
||||
source_address: 192.168.1.1
|
||||
access_list:
|
||||
- network: 192.0.2.0/24
|
||||
action: deny
|
||||
- network: 10.0.0.0/8
|
||||
action: permit
|
||||
ipv6: null
|
||||
proxy: null
|
||||
- name: atl_router01
|
||||
address: 10.0.0.2
|
||||
network:
|
||||
name: secondary
|
||||
display_name: That Other Network
|
||||
credential:
|
||||
username: user2
|
||||
password: secret2
|
||||
display_name: Atlanta, GA
|
||||
port: 22
|
||||
nos: juniper
|
||||
vrfs:
|
||||
- name: default
|
||||
display_name: Global
|
||||
ipv4:
|
||||
source_address: 192.0.2.2
|
||||
access_list:
|
||||
- network: 10.0.0.0/8
|
||||
action: deny
|
||||
- network: 192.168.0.0/16
|
||||
action: deny
|
||||
- network: 172.16.0.0/12
|
||||
action: deny
|
||||
- network: 0.0.0.0/0
|
||||
action: permit
|
||||
ge: 8
|
||||
le: 24
|
||||
ipv6:
|
||||
source_address: 2001:db8::2
|
||||
access_list:
|
||||
- network: ::/0
|
||||
action: permit
|
||||
ge: 32
|
||||
le: 64
|
||||
proxy:
|
||||
name: server01
|
||||
address: 10.11.6.204
|
||||
port: 22
|
||||
credential:
|
||||
username: user1
|
||||
password: secret1
|
||||
nos: linux_ssh
|
||||
username: test
|
||||
password: test
|
||||
platform: juniper
|
||||
directives:
|
||||
- '*'
|
||||
- juniper_bgp_route
|
||||
|
|
|
|||
17
hyperglass/examples/directives.yaml
Normal file
17
hyperglass/examples/directives.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
juniper_bgp_route:
|
||||
name: BGP Route
|
||||
groups:
|
||||
- Global
|
||||
rules:
|
||||
- condition: '1.0.0.1/32'
|
||||
action: deny
|
||||
- condition: '0.0.0.0/0'
|
||||
ge: 8
|
||||
le: 25
|
||||
command: 'show route protocol bgp table inet.0 {target} detail'
|
||||
- condition: '::/0'
|
||||
ge: 16
|
||||
le: 64
|
||||
command: 'show route protocol bgp table inet6.0 {target} detail'
|
||||
field:
|
||||
description: IP Address or Prefix
|
||||
1
hyperglass/ui/package.json
vendored
1
hyperglass/ui/package.json
vendored
|
|
@ -11,6 +11,7 @@
|
|||
"start": "next start",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"format": "prettier --config ./.prettierrc -c -w .",
|
||||
"format:check": "prettier --config ./.prettierrc -c .",
|
||||
"build": "export NODE_OPTIONS=--openssl-legacy-provider; next build && next export -o ../hyperglass/static/ui",
|
||||
"test": "jest"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue