Skip to content

Commit

Permalink
add doc generation stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed May 6, 2018
1 parent d6d3182 commit a8fe9c1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -8,8 +8,8 @@ after_success:
- echo "secure travis:" "$TRAVIS_SECURE_ENV_VARS"
# Update the TRAVIS_BRANCH value as necessary to force the build/deploy of the website
# if both CXX==g++ and TRAVIS_BRANCH==value
- sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "master"; then echo "publish website"; ./scripts/ci/build_docs.sh; ./scripts/ci/deploy_website.sh
$TRAVIS_BUILD_DIR/doc/build; fi'
- sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "master"; then echo "publish website"; ./scripts/ci/build_docs.sh; ./scripts/ci/add_deploy_key.sh; ./scripts/ci/deploy_website.sh
$TRAVIS_BUILD_DIR/doc/build /tmp; fi'
env:
global:
- secure: INQ5c8x+mSk1gsniJrhVss/iV0DZ2g0T3SvWvAj4gsZXAmzNKOb6BApptoiZvlu3LefnW2wAVAmqdoGGyiwTiYAudR6bKQTyIXVToEc3Phl5p/YnjDyojLmNutgbrxOsX9rHZJY43pwLDSNxCoN5s17x0Mnxg5ZKJmXMGHMciiQ=
Expand Down
10 changes: 10 additions & 0 deletions scripts/ci/add_deploy_key.sh
@@ -0,0 +1,10 @@
#!/bin/bash

if [ -n "$encrypted_452b0f7e50bb_key" ]; then
openssl aes-256-cbc -K $encrypted_452b0f7e50bb_key -iv $encrypted_452b0f7e50bb_iv -in scripts/ci/pdaldocs-private.key.enc -out scripts/ci/pdaldocs-private.key-d
cp scripts/ci/pdaldocs-private.key ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
fi;


20 changes: 18 additions & 2 deletions scripts/ci/deploy_website.sh
@@ -1,9 +1,25 @@
#!/bin/bash

builddir=$1
destdir=$2
DATE=$(date +'%y.%m.%d %H:%M:%S')

git clone git@github.com:hobu/greyhound.git $destdir/pdaldocs
cd $destdir/pdaldocs
git checkout gh-pages

echo "deploying docs for $TRAVIS_BUILD_DIR/docs"

docker run -e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" -e "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" -v $TRAVIS_BUILD_DIR:/data -w /data/doc hobu/entwine-docs aws s3 sync ./build/html/ s3://greyhound.io --acl public-read
cd $builddir/html
cp -rf * $destdir/pdaldocs

cd $builddir/latex/
cp PDAL.pdf $destdir/pdaldocs

cd $destdir/pdaldocs
git config user.email "pdal@hobu.net"
git config user.name "PDAL Travis docsbot"

git add -A
git commit -m "update with results of commit https://github.com/hobu/greyhound/commit/$TRAVIS_COMMIT for ${DATE}"
git push origin master

Binary file added scripts/ci/pdaldocs-private.key.enc
Binary file not shown.

0 comments on commit a8fe9c1

Please sign in to comment.