Skip to content

Commit

Permalink
Activate GH Page
Browse files Browse the repository at this point in the history
  • Loading branch information
titom73 committed Jun 3, 2020
1 parent 2598680 commit c41a421
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 2 deletions.
90 changes: 90 additions & 0 deletions .github/collector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/python
# coding: utf-8 -*-

#
# GNU General Public License v3.0+
#
# Copyright 2020 TiTom73
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: //www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import os
import sys
import requests
from jinja2 import Environment, FileSystemLoader

GH_API_ENDPOINT = 'https://api.github.com/users/arista-netdevops-community/repos'
JSON_FIELDS = { 'name':'project_name', 'description':'description', 'html_url':'homepage', 'updated_at': 'last_commit'}
TEMPLATE_MARKDOWN = 'page.md.j2'
OUTPUT_FILE = '../docs/index.md'

def get_gh_api(url):
"""
get_gh_api Extract information using GET
Collect Github data from their public API
Current version does not support authentication
Parameters
----------
url : string
Github API string to get.
Returns
-------
json
Response from GH.
"""
response = requests.get(url)
if response.status_code == requests.codes.ok:
return response.json()
return {}

def extract_fields(gh_json, fields):
"""
extract_fields Extract field from GH API data
Extract fields from GH API data and standardize name of keys
Parameters
----------
gh_json : json
JSON content from Github
fields : dict
A list of fields to extract and the name we want to use as standard.
"""
data = list()
for entry in gh_json:
cell = dict()
for field in fields:
cell[fields[field]] = entry[field]
data.append(cell)
return data


if __name__ == '__main__':
data = get_gh_api(url=GH_API_ENDPOINT)
projects = extract_fields(gh_json=data, fields=JSON_FIELDS)
root = os.path.dirname(os.path.abspath(__file__))
env = Environment( loader = FileSystemLoader(root) )
env.trim_blocks = True
env.lstrip_blocks = True
env.rstrip_blocks = True
template = env.get_template(TEMPLATE_MARKDOWN)
output = template.render(projects=projects)
filename = os.path.join(root, OUTPUT_FILE)
with open(filename, 'w') as fh:
fh.write(output)

sys.exit(0)
29 changes: 29 additions & 0 deletions .github/page.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Arista Netdevops Community

!!! warning
Tis page is under construction and will reflect a list of all repositories part of Arista Community Github group.


## About

This page is automatically generated with a Py script to list all repositories part of [`arista-netdevops-community`](https://github.com/arista-netdevops-community)

## List of projects

List of all projects available in Arista Netdevops community. Feel free to go through these repositories and find your way.

| Project's Name | Description | Last Commit |
|------------------|---------------|-------------|
{% for project in projects|sort(reverse=true,attribute='last_commit') %}
| [{{project['project_name']}}]({{project['homepage']}}) | {% if project['description'] != 'None' %} {{project['description']}} {% else %} N/A {% endif %} | Last Commit {{project['last_commit']|truncate(10,end='')}} |
{% endfor %}


## List of projects

Or another presentastion

{% for project in projects|sort(reverse=true,attribute='last_commit') %}
- __[{{project['project_name']}}]({{project['homepage']}})__: {% if project['description'] != 'None' %} {{project['description']}} {% else %} N/A {% endif %} ({{project['last_commit']|truncate(10,end='')}})

{% endfor %}
14 changes: 14 additions & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Jinja2==2.10.3
mistune==0.8.4
mkdocs==1.1.2
mkdocs-bootswatch==1.1
requests==2.22.0
traitlets==4.3.3
treelib==1.5.5
urllib3==1.25.9
mkdocs-bootswatch==1.1
mkdocs-material==5.1.1
mkdocs-material-extensions==1.0b2
fontawesome-markdown==0.2.6
pymdown-extensions
mkdocs-rtd-dropdown
27 changes: 27 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Mkdocs
on:
# Rebuild every day at 00:00
schedule:
- cron: '0 0 * * *'
# Or on every push as it can change output
push:
jobs:
'doc':
name: 'Update Public documentation'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: 'Setup Python 3 on runner'
uses: actions/setup-python@v1.2.0
with:
python-version: '3.x'
- name: 'Build mkdocs content to site folder'
run: |
pip install -r .github/requirements.txt
python .github/collector.py
mkdocs build -f mkdocs.yml
- name: 'Deploy last version to gh-pages'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This repository is a central place where Arista demos and examples around netdevops methodology.

<p align="center">
<img src="media/figure-1-arista-automation.png" width="600"/>
<img src="docs/media/figure-1-arista-automation.png" width="600"/>
</p>

## Available content
Expand All @@ -20,7 +20,7 @@ This repository is a central place where Arista demos and examples around netdev
- [__Ansible to sync configlets across CV servers__](ansible/ansible-sync-configlets): Content to synchronize configlets from one CV server to another. Complete documenation is available on our [EOS Central Knowledge base](https://eos.arista.com/synchronising-cloudvision-portal-configlets-with-ansible/)

### Virtual Labs
- [__List of some EVE-NG topologies leveraging vEOS and CV__](virtual_lab/EVE-NG):
- [__List of some EVE-NG topologies leveraging vEOS and CV__](virtual_lab/EVE-NG):
- [__L3 Leaf-Spine w/ BGP Unnumbered & EVPN VXLAN__](virtual_lab/EVE-NG/labs/L3LS_Unnumbered_DCI_Type5): full Layer 3 Leaf-Spine fabric in a 2 datacenter setup with BGP Unnumbered and VXLAN/EVPN
- [__NSX-T and EVPN in EVE-NG lab__](virtual_lab/EVE-NG/labs/NSX-T_EVPN_Type-5): Lab to demonstrate integration of Arista EOS running EVPN with Vmware NSX-T integration.

Expand Down
41 changes: 41 additions & 0 deletions docs/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
![](https://img.shields.io/badge/Arista-CVP%20Automation-blue) ![](https://img.shields.io/badge/Arista-EOS%20Automation-blue) ![GitHub](https://img.shields.io/github/license/aristanetworks/netdevops-examples)

# Arista Netdevops Examples

## About

This repository is a central place where Arista demos and examples around netdevops methodology.


## Available content

### Demo Content

- [__Arista Validated Design__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/avd-evpn-l3ls-1/): Generate EOS EVPN/VXLAN Fabric deployed using CloudVision and with pre/post deployment tests.
- [__Zero Touch Provisioning to EVPN Fabric__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/ztp-avd-cvp): Build a complete EVPN/VXLAN fabric using CloudVision and Zero Touch Provisioning process.
- [__Ansible AVD & CVP Transfer of Information__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/avd-cvp-toi): Content to build a Transfer of Information on Arista Validated Design and Cloudvision collection.
- [__Ansible to sync configlets across CV servers__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/ansible-sync-configlets): Content to synchronize configlets from one CV server to another. Complete documenation is available on our [EOS Central Knowledge base](https://eos.arista.com/synchronising-cloudvision-portal-configlets-with-ansible/)

### Virtual Labs
- [__List of some EVE-NG topologies leveraging vEOS and CV__](https://github.com/aristanetworks/netdevops-examples/tree/master/virtual_lab/EVE-NG):
- [__L3 Leaf-Spine w/ BGP Unnumbered & EVPN VXLAN__](https://github.com/aristanetworks/netdevops-examples/tree/master/virtual_lab/EVE-NG/labs/L3LS_Unnumbered_DCI_Type5): full Layer 3 Leaf-Spine fabric in a 2 datacenter setup with BGP Unnumbered and VXLAN/EVPN
- [__NSX-T and EVPN in EVE-NG lab__](https://github.com/aristanetworks/netdevops-examples/tree/master/virtual_lab/EVE-NG/labs/NSX-T_EVPN_Type-5): Lab to demonstrate integration of Arista EOS running EVPN with Vmware NSX-T integration.

### Webinar & Presentation content

- [__Network Field Days 22__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/ansible-batfish-cv-nfd22/): Ansible & Batfish ([NFD22 webpage](https://techfieldday.com/appearance/arista-networks-presents-at-networking-field-day-22/))
- [__Tech Friday March 2020__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/tech-friday-march2020/): Lab used during Tech Friday event.
- [__Network Automation with Ansible & Cloudvision - EMEA Webinar April 2020__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/emea-2020-ansible-cvp-automation): Build an EVPN/VXLAN Fabric using Ansible & Cloudvision with pot deployment validation using WARD
- [__Network Field Days 22__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/ansible-batfish-cv-nfd22/): Ansible & Batfish ([NFD22 webpage](https://techfieldday.com/appearance/arista-networks-presents-at-networking-field-day-22/)).

## License

All examples and demos available in this repository are provided under [Apache License](https://github.com/aristanetworks/netdevops-examples/tree/master/LICENSE)

# Ask question or report issue

Please open an issue on Github this is the fastest way to get an answer.

# Contribute

Contributing pull requests are gladly welcomed for this repository. If you are planning a big change, please start a discussion first to make sure we’ll be able to merge it.
31 changes: 31 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Arista Netdevops Community

!!! warning
Tis page is under construction and will reflect a list of all repositories part of Arista Community Github group.


## About

This page is automatically generated with a Py script to list all repositories part of [`arista-netdevops-community`](https://github.com/arista-netdevops-community)

## List of projects

List of all projects available in Arista Netdevops community. Feel free to go through these repositories and find your way.

| Project's Name | Description | Last Commit |
|------------------|---------------|-------------|
| [kvm-lab-for-network-engineers](https://github.com/arista-netdevops-community/kvm-lab-for-network-engineers) | cheatsheet explaining how to build vEOS lab based on KVM | Last Commit 2020-06-03 |
| [CVP_Provisioning](https://github.com/arista-netdevops-community/CVP_Provisioning) | None | Last Commit 2020-05-26 |
| [docker-avd-base](https://github.com/arista-netdevops-community/docker-avd-base) | None | Last Commit 2020-05-01 |


## List of projects

Or another presentastion

- __[kvm-lab-for-network-engineers](https://github.com/arista-netdevops-community/kvm-lab-for-network-engineers)__: cheatsheet explaining how to build vEOS lab based on KVM (2020-06-03)

- __[CVP_Provisioning](https://github.com/arista-netdevops-community/CVP_Provisioning)__: None (2020-05-26)

- __[docker-avd-base](https://github.com/arista-netdevops-community/docker-avd-base)__: None (2020-05-01)

File renamed without changes
84 changes: 84 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
:root {
/* Color schema based on Arista Color Schema */
/* Default color shades */
--md-default-fg-color: #000000;
--md-default-fg-color--light: #a1a0a0;
--md-default-fg-color--lighter: #FFFFFF;
--md-default-fg-color--lightest: #FFFFFF;
--md-default-bg-color: #FFFFFF;
--md-default-bg-color--light: #FFFFFF;
--md-default-bg-color--lighter: #FFFFFF;
--md-default-bg-color--lightest: #FFFFFF;

/* Primary color shades */
--md-primary-fg-color: #5487B7;
--md-primary-fg-color--light: #FFFFFF;
--md-primary-fg-color--dark: #5487B7;
--md-primary-bg-color: #FFFFFF;
--md-primary-bg-color--light: #FFFFFF;

/* Accent color shades */
--md-accent-fg-color: #5487B7;
--md-accent-bg-color: #5487B7;
--md-accent-bg-color--light: #5487B7;

/* Code block color shades */
--md-code-bg-color: #f6f8fa;
/* --md-code-fg-color: ...; */
}

@media only screen and (min-width: 76.25em) {
.md-main__inner {
max-width: 85%;
}
.md-sidebar--primary {
left: 5%;
}
.md-sidebar--secondary {
right: 5%;
margin-left: 0;
-webkit-transform: none;
transform: none;
}
}

@media only screen {
.md-footer-nav {
background-color: var(--md-default-bg-color--light);
color: var(--md-accent-fg-color--transparent)
}
.md-typeset code {
padding: 0 .2941176471em;
font-size: 1;
word-break: break-word;
background-color: var(--md-code-bg-color);
border-radius: .1rem;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.md-footer {
height: 2%;
}
.md-footer-nav__direction {
position: absolute;
right: 0;
left: 0;
margin-top: -1rem;
padding: 0 1rem;
color: var(--md-default-fg-color--light);
font-size: .64rem;
}
.md-footer-nav__title {
font-size: .9rem;
line-height: 2.4rem;
color: var(--md-default-fg-color--light);
}
.md-typeset table:not([class]) th {
min-width: 5rem;
padding: .6rem .8rem;
color: var(--md-default-fg-color--lighter);
vertical-align: top;
background-color: var(--md-accent-bg-color);
}
}

49 changes: 49 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
site_name: Arista Devops Community
site_author: Arista Ansible Team
site_description: A List of contribution in devops world
docs_dir: docs/
theme:
name: 'readthedocs'
features:
- instant
font:
text: Ubuntu
code: Ubuntu Mono
extra_css:
- stylesheets/extra.css
copyright: Copyright &copy; 2019 - 2020 Arista Networks
repo_name: 'Arista Netdevops Community'
repo_url: https://github.com/aristanetworks/netdevops-examples
use_directory_urls: true
nav:
- Arista Netdevops Repositories: index.md
- Existing Netdevops Examples: github.md
- About:
- Ansible Galaxy page: https://galaxy.ansible.com/arista/cvp
- Arista Validated Design: https://github.com/aristanetworks/ansible-avd
- Arista Automation Community: https://github.com/arista-netdevops-community

markdown_extensions:
- smarty
- pymdownx.arithmatex
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- fontawesome_markdown
- admonition
- codehilite:
guess_lang: true
- toc:
separator: "-"
permalink: "#"
baselevel: 1

0 comments on commit c41a421

Please sign in to comment.