Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
[NEW] Build and deploy github sphinix project page
Browse files Browse the repository at this point in the history
  • Loading branch information
mileo committed Jan 6, 2017
1 parent d63559c commit 2506350
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
12 changes: 12 additions & 0 deletions travis/travis_after_tests_success
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python

import os
import sys
import subprocess

from coverage.cmdline import main as coverage_main
from coveralls import cli as coveralls_cli
Expand All @@ -19,3 +21,13 @@ if (os.environ.get('TESTS', '1') == '1' and
codecov_main(argv=None)
except:
pass

if os.environ.get('AUTODOC') == '1':
odoo_version = os.environ.get("VERSION")
proc = subprocess.call([
'travis-sphinx',
'--branch=%s' % odoo_version,
'deploy'
])
sys.exit(proc.returncode)

20 changes: 20 additions & 0 deletions travis/travis_autodoc_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
import os
import subprocess
import sys

from getaddons import get_modules


root_dir = os.path.dirname(os.path.abspath(__file__))
status = 0

for addon in get_modules(os.path.abspath('.')):
status += subprocess.call(['sphinx-apidoc',
'-f',
'-o',
'docs/source/addons/%s' % addon,
addon])
status += subprocess.call(['travis-sphinx', '-n', 'build'])

sys.exit(0 if status == 0 else 1)
7 changes: 7 additions & 0 deletions travis/travis_autodoc_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sphinx
sphinx-rtd-theme
sphinx_bootstrap_theme
odoo-sphinx-autodoc
docutils
pillow
travis-sphinx
4 changes: 4 additions & 0 deletions travis/travis_install_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ if [ "${LINT_CHECK}" != "0" ]; then
exit 0
fi

if [ "${AUTODOC}" != "0" ]; then
pip install --upgrade -r travis_autodoc_requirements.txt
fi

# We can exit here and do nothing if this only a LINT check
if [ "${TESTS}" != "1" ] && [ "${LINT_CHECK}" == "1" ]; then
exit 0
Expand Down
4 changes: 4 additions & 0 deletions travis/travis_run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if __name__ == '__main__':
is_oca_project = os.environ.get('TRAVIS_REPO_SLUG', '').startswith('OCA/')
is_oca_transifex_user = os.environ.get('TRANSIFEX_USER') == \
'[email protected]'
doc_enabled = os.environ.get('AUTODOC') == '1'

# TRAVIS_PULL_REQUEST contains the pull request number or 'false'
is_pull_request = os.environ.get('TRAVIS_PULL_REQUEST') != 'false'
Expand All @@ -79,5 +80,8 @@ if __name__ == '__main__':
if transifex_enabled and is_valid_transifex:
tests.append(['travis_transifex.py'])

if doc_enabled:
tests.append(['travis_autodoc_build'])

if tests:
exit(main(tests))

0 comments on commit 2506350

Please sign in to comment.