This script expects to find a requirements.txt file listing your pip dependencies. You can create this file using the following command:
pip freeze > requirements.txt
##Setup
S3
- Create an S3 Bucket (save your credentials for Travis!)
Travis
This script requires that your build has sudo: required
in your .travis.yml due
to sudo
usage.
-
Add
sudo: required
to your .travis.yml (sudo is required to install sphinx etc.) -
Set Travis environment variables:
AWS_ACCESS_KEY_ID
(with your aws access key)AWS_SECRET_ACCESS_KEY
(with your aws secret key)AWS_BUCKET
(with your bucket name)AWS_ACL
Optional - defaults topublic-read
-
Add script invocation to
after_script
like so:after_script: git clone https://github.com/perfectsense/travis-sphinx-deploy.git && travis-sphinx-deploy/deploy.sh brightspot/developers-guide brightspot/developers-guide/_build/html
Example assumes Makefile is in
brightspot/developers-guide
and resulting build output will be inbrightspot/developers-guide_build/html
Setup Redirect
S3 does not support the index of your static site being inside of a subdirectory, to accomplish this, you can upload an empty index.html file into the root of your bucket, and setup a redirect to your index.html inside of your folder.
Performs the following actions:
- Updates pip to version 9.0.3
- Installs sphinx
- Runs Sphinx
- Deploys Sphinx site to S3 (directory changes for release branches)