Skip to content
Permalink
Browse files

Add auto-doc generation

  • Loading branch information...
jsgf committed Feb 12, 2016
1 parent 9d52be0 commit 55a4bb4ff7a8ff565363363836d11e321cfa5326
Showing with 62 additions and 5 deletions.
  1. +43 −0 .travis-update-gh-pages.sh
  2. +17 −5 .travis.yml
  3. +1 −0 xdr-codec/Cargo.toml
  4. +1 −0 xdrgen/Cargo.toml
@@ -0,0 +1,43 @@
#!/bin/bash

# based on: http://sleepycoders.blogspot.se/2013/03/sharing-travis-ci-generated-files.html
# and: https://gist.github.com/domenic/ec8b0fc8ab45f39403dd

set -e # exit with nonzero exit code if anything fails

#env | sed -e 's,GH_TOKEN=.*,GH_TOKEN=XXX,'

# Only do it if not acting on a pull request.
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

echo git setup
# Go to home and setup git
cd $HOME
git config --global user.name "Travis CI"
git config --global user.email "travis@travis-ci.org"

echo git clone ${GH_REPO}
# Using token clone gh-pages branch. Pipe to /dev/null to avoid printing the decrypted key.
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@${GH_REPO} gh-pages > /dev/null 2>&1

echo pages mkdir
# Go there, and overwrite everything with the freshly built contents.
mkdir -p gh-pages/doc # in case it's the first time

echo copy
cd gh-pages/doc
rm -rf *
for docs in $DOCS_OUT; do
cp -Rf $TRAVIS_BUILD_DIR/$docs/. .
done

echo add
# add, commit and push files
git add --all -f .

echo commit
git commit -m "Travis build $TRAVIS_BUILD_NUMBER docs pushed to gh-pages"

echo push
git push -fq origin gh-pages > /dev/null 2>&1
fi
@@ -1,9 +1,21 @@
language: rust

rust:
- nightly
- nightly

script:
- (cd xdr-codec && cargo build --verbose)
- (cd xdr-codec && cargo test --verbose)
- (cd xdrgen && cargo build --verbose)
- (cd xdrgen && cargo test --verbose)
- "(cd xdr-codec && cargo build --verbose)"
- "(cd xdr-codec && cargo test --verbose)"
- "(cd xdr-codec && cargo doc --no-deps --verbose)"
- "(cd xdrgen && cargo build --verbose)"
- "(cd xdrgen && cargo test --verbose)"
- "(cd xdrgen && cargo doc --no-deps --verbose)"

after_success:
- ./.travis-update-gh-pages.sh

env:
global:
- GH_REPO: github.com/jsgf/rust-xdr.git
- DOCS_OUT="xdrgen/target/doc xdr-codec/target/doc"
- secure: CUnvQ3QAJEBfahqtsWTb72dvSB4xyebRIK3j/wwRNRP2evxwY1765VGTfV2zoPUD1MuR/8olEuHhs/b34tBMxhyMYZd2RGn+xuX4jD6aav318oVN2B4Y1sBDTme9QDW5XVDetKQlfjzYZM98C3YyxktuE66/Bar9D7g894EhC4KDjFv1G0REWy0bUlBcYh3JBO37lSHXE5g6noh/LlCRgFcno51irCoH/8qq+tCI3avAzAPS9lPYEUwr0xNRUpu61qTyf9riggcp/xAn96YMH+icJgmv/Ctbf3mr7DgJlSwces6iog/vjSnut52jChp52ci+iwmyfo8WCfThMQYFkIZEPkdFbLX1JpdlvT2LgHcrKdVq2JtL/HvUb8Oma+T4DZYlJRMg2jTMJcstta4Ik2RSBhj2RtmuZ1Ktp6Ty+Bt/0JyLYiwx6uVRkBSdKCrOX1S5Y9y06vbVz92WU15tuuF8cR9aPT7ND/HKe9jYtND7T0Z1pSj7ZKRGi+EGy7LZHZ1Pc/35AV5rcChEEpr0zVVDY7VyZctLCFksYVg3qkYvOKpp3pUlQS4HH28U2bvsFH2vghk18LMvBjqutPIhsSLDyYUTOdJWKW1LL5SgfifI3mqqSjc06HygDw3WClmMD49fnaAkLXlhN4bW/sQ2TffDVgCfoGdh7j4Cvfs2pXo=
@@ -5,6 +5,7 @@ authors = ["Jeremy Fitzhardinge <jeremy@goop.org>"]
license = "MIT"
description = "XDR encode/decode runtime support. Pairs with xdrgen which generates code from specs."
repository = "https://github.com/jsgf/rust-xdr-codec"
documentation = "https://jsgf.github.io/rust-xdr/doc/xdr-codec/index.html"
readme = "README.md"
keywords = ["encoding", "protocol", "xdr", "rfc4506", "serialization"]

@@ -5,6 +5,7 @@ authors = ["Jeremy Fitzhardinge <jeremy@goop.org>"]
license = "MIT"
description = "XDR codec generator from specification and runtime library"
repository = "https://github.com/jsgf/rust-xdrgen"
documentation = "https://jsgf.github.io/rust-xdr/doc/xdrgen/index.html"
readme = "README.md"
keywords = ["encoding", "protocol", "xdr", "rfc4506", "serialization"]

0 comments on commit 55a4bb4

Please sign in to comment.
You can’t perform that action at this time.