Skip to content

Commit 6fc7059

Browse files
author
Lorin Hochstein
committed
Automatically build docs on merge to master
This comit will automatically build docs and push them to the gh-pages branch.
1 parent fdd27cd commit 6fc7059

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ sudo: required
33

44
language: go
55

6+
env:
7+
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
8+
69
services:
710
- docker
811

@@ -11,7 +14,6 @@ install:
1114
- go get github.com/golang/lint/golint
1215
- go get github.com/kisielk/errcheck
1316

14-
1517
# With the "docker" tag enabled,
1618
# the mysql:5.6 docker container will be started
1719
# and the mysql tests will connect to this container
@@ -24,3 +26,5 @@ script:
2426
- errcheck -ignore 'io:Close' -ignoretests `go list ./... | grep -v /vendor/`
2527
- go test -v -tags docker ./...
2628

29+
after_success:
30+
- ./update-docs.sh

docKey.enc

3.17 KB
Binary file not shown.

docs/index.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Chaos Monkey
2+
3+
Eventually, this page will contain the proper documentation for Chaos Monkey.
4+
5+
Until then, check out the [wiki][1].
6+
7+
[1]: https://github.com/netflix/chaosmonkey/wiki

mkdocs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
site_name: Chaos Monkey
2+
theme: readthedocs
3+
copyright: <b>A Netflix Original Production</b><br><a href="http://netflix.github.io/">Netflix OSS</a> | <a href="http://techblog.netflix.com/">Tech Blog</a> | <a href="https://twitter.com/NetflixOSS">Twitter @NetflixOSS</a> | <a href="https://jobs.netflix.com">Jobs</a>

update-docs.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e
3+
echo "DEPLOY_DOCS=$DEPLOY_DOCS"
4+
if [[ $DEPLOY_DOCS != true ]]; then
5+
echo "Not building docs"
6+
exit 0
7+
fi
8+
9+
echo "Building docs"
10+
11+
# Install mkdocs
12+
virtualenv venv
13+
venv/bin/pip install mkdocs
14+
15+
# Decrypt and load the ssh key
16+
openssl aes-256-cbc -K $encrypted_5704967818cd_key -iv $encrypted_5704967818cd_iv -in docKey.enc -out docKey -d
17+
chmod 0600 docKey
18+
eval `ssh-agent -s`
19+
ssh-add docKey
20+
21+
22+
# Push up to gh-pages
23+
# --force is required otherwise it will fail to push up
24+
venv/bin/mkdocs gh-deploy --remote-name [email protected]:Netflix/chaosmonkey.git --force

0 commit comments

Comments
 (0)