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 Dec 5, 2016
1 parent d63559c commit 363d9fd
Show file tree
Hide file tree
Showing 4 changed files with 44 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,11 +1,14 @@
#!/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
from codecov import main as codecov_main

status = 0

if (os.environ.get('TESTS', '1') == '1' and
os.environ.get('TEST_ENABLE', '1') == '1' and
Expand All @@ -19,3 +22,12 @@ if (os.environ.get('TESTS', '1') == '1' and
codecov_main(argv=None)
except:
pass

if os.environ.get('DOC') == '1':
odoo_version = os.environ.get("VERSION")
status += subprocess.call(['travis-sphinx',
'--branch=%s' % odoo_version,
'deploy'
])

sys.exit(0 if status == 0 else 1)
20 changes: 20 additions & 0 deletions travis/travis_doc_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)
8 changes: 8 additions & 0 deletions travis/travis_install_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ if [ "${LINT_CHECK}" != "0" ]; then
exit 0
fi

if [ "${DOC}" != "0" ]; then
pip install --upgrade sphinx sphinx-rtd-theme sphinx_bootstrap_theme odoo-sphinx-autodoc
pip install --upgrade docutils
pip install --upgrade pillow
pip install --upgrade --user travis-sphinx
export PATH=$HOME/.local/bin:$PATH
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('DOC') == '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_doc_build'])

if tests:
exit(main(tests))

0 comments on commit 363d9fd

Please sign in to comment.