Add Gitlab CI stage to build documentation.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-09-27 01:21:44 -04:00
parent 635263dc95
commit 2d69c6114b

View File

@@ -2,8 +2,10 @@ stages:
- test
- build_python
- build_docker
- build_documentation
- push_python
- push_docker
- push_documentation
- deploy
job_docker_build:
@@ -59,6 +61,43 @@ job_docker_nightly:
- nightly
- staging
job_documentation_build:
stage: build_documentation
image: ubuntu:18.04
artifacts:
expire_in: 1 hr
paths:
- docs
before_script:
- apt-get -qq update
- apt-get install -qq locales make python-pip
- echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale
- locale-gen en_US.UTF-8
- update-locale LANG=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
script:
- pip install -r requirements/documentation.txt
- cd docs
- make html
only:
- releases/documentation
job_documentation_push:
stage: push_documentation
image: ubuntu:18.04
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$DOCUMENTATION_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync -y )'
- eval $(ssh-agent -s)
- echo "$DOCUMENTATION_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
script:
- rsync -avzP --progress -e ssh docs/_build/html/* mayandocs@docs.mayan-edms.com:/home/rosarior/webapps/mayan_docs
only:
- releases/documentation
job_build_python:
stage: build_python
image: ubuntu:18.04