Automated docs updates via travis-ci

Uses the Python 3.5 build to generate the docs.
Then, if there are any changes, it pushes them
to the streamlink.github.io repo using a key
pair. The deploy-key.enc file here is the private
key of that pair. The public key was added to the
streamlink.github.io repo as a deploy key.
This commit is contained in:
Simon Bernier St-Pierre 2016-09-23 19:27:26 -04:00
parent e0da0de1bd
commit 89526c792f
4 changed files with 44 additions and 9 deletions

View File

@ -2,22 +2,25 @@ language: python
sudo: false
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
matrix:
include:
- python: "2.6"
- python: "2.7"
- python: "3.3"
- python: "3.4"
- python: "3.5"
env: BUILD_DOCS=yes
before_install:
before_install:
- pip install pytest pytest-cov coveralls coverage
- travis_retry gem install --version 0.8.9 faraday
install:
- python setup.py install
script:
script:
- python -m pytest -vv --cov streamlink
- bash script/pushdocs.sh
after_success:
- sh .travis/build-win32.sh

BIN
deploy-key.enc Normal file

Binary file not shown.

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
# Execute this at the base of the streamlink repo.
# Requires: sphinx
if [ "$#" -ne 1 ] ; then
echo "Path to streamlink.github.io repo is required."
@ -9,6 +8,7 @@ fi
DOCS_REPO_PATH="$1"
pip install sphinx
make --directory=docs html
# remove old files

32
script/pushdocs.sh Normal file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
if [ "$TRAVIS_BRANCH" != "master" ] || [ "$BUILD_DOCS" != "yes" ] ; then
exit 0
fi
DOCS_REPO_NAME="streamlink.github.io"
DOCS_REPO_URL="git@github.com:streamlink/streamlink.github.io.git"
DOCS_KEY="deploy-key"
DOCS_USER="Travis CI"
# deal with private key
openssl aes-256-cbc -K $encrypted_25fada573976_key -iv $encrypted_25fada573976_iv -in "$DOCS_KEY.enc" -out "$DOCS_KEY" -d
chmod 600 "$DOCS_KEY"
eval `ssh-agent -s`
ssh-add "$DOCS_KEY"
# clone the repo
git clone "$DOCS_REPO_URL" "$DOCS_REPO_NAME"
bash script/makedocs.sh "$DOCS_REPO_NAME"
# git config
cd "$DOCS_REPO_NAME"
git config user.name "$DOCS_USER"
git config user.email "<>"
git add --all
# Check if anythhing changed, and if it's the case, push to origin/master.
if git commit -m 'update docs' -m "Commit: https://github.com/sbstp/travis-test/commit/$TRAVIS_COMMIT" ; then
git push origin master
fi
exit 0