diff --git a/.gitignore b/.gitignore index 589556079..ad3233a8a 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ tags docs/integrations/ansible/modules/napalm_*/ docs/integrations/ansible/modules/source/*.json +docs/napalm_ansible_repo/ \ No newline at end of file diff --git a/docs/build-ansible-module-docs.sh b/docs/build-ansible-module-docs.sh new file mode 100755 index 000000000..474f6e799 --- /dev/null +++ b/docs/build-ansible-module-docs.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +CWD=`pwd` +MODULES_OUTPUT="$CWD/integrations/ansible/modules/source" + + + +git clone https://github.com/napalm-automation/napalm-ansible.git napalm_ansible_repo +cd napalm_ansible_repo + +# Change to master after next napalm-ansible release +git checkout develop + +pip install -r requirements-dev.txt +pip install . +py.test +cp module_docs/* $MODULES_OUTPUT/ + +cd $CWD + diff --git a/docs/conf.py b/docs/conf.py index 7d08b3071..7d4c33839 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -81,7 +81,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ['_build', 'napalm_ansible_repo'] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -310,7 +310,7 @@ def build_napalm_ansible_module_docs(app): """Create documentation for Ansible modules.""" # Add script to clone napalm-ansible repo - status = 0 + status = subprocess.call("./build-ansible-module-docs.sh", stdout=sys.stdout, stderr=sys.stderr) if status != 0: print("Something bad happened when processing the Ansible modules.")