Commit 3668e2ad by Dave Syer

Update travis build for docs sync

parent 094abc6f
language: java
install: mvn install -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
before_install: git config user.name "$GIT_NAME" && git config user.email "$GIT_EMAIL"
&& git config credential.helper "store --file=.git/credentials" && echo "https://$GH_TOKEN:@github.com" > .git/credentials
install:
- mvn install -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
- ./src/main/asciidoc/ghpages.sh
script: mvn --settings .settings.xml deploy -nsu -Dmaven.test.redirectTestOutputToFile=true
env:
global:
- secure: JXDn4awZAYbhxPV9PIn0I+wUv+PwLJ5TLWFVW2q9rQqeJVDJd3KB0WRXSFOi03g/rGFbN0j+JCqgJPW/I91yEwC55AWbr2DG9fB7HuyQe6OKNT7qZkmoDxrfkYhaN7OLwcNf7vP4kXwzKqIbmSLfsrF1M/aVAPdXw9u6TPL+9i0=
- secure: cwftjc6405DztK+P2oJYsxSZWYqozsAWPaLPzuqq/1bTjp+3WAPkV+/OGWiZDW7Exd/z958McQMSONIab/CgLvfenrYc38ErjKstdovyduYs905aVitlUk19dOiH35qJgeFl9+6zNWIOB4OysWsBmdnmtbk1avM/v/Ove3bJvcE=
- GIT_NAME="Dave Syer"
- GIT_EMAIL=dsyer@pivotal.io
- secure: JXDn4awZAYbhxPV9PIn0I+wUv+PwLJ5TLWFVW2q9rQqeJVDJd3KB0WRXSFOi03g/rGFbN0j+JCqgJPW/I91yEwC55AWbr2DG9fB7HuyQe6OKNT7qZkmoDxrfkYhaN7OLwcNf7vP4kXwzKqIbmSLfsrF1M/aVAPdXw9u6TPL+9i0=
- secure: cwftjc6405DztK+P2oJYsxSZWYqozsAWPaLPzuqq/1bTjp+3WAPkV+/OGWiZDW7Exd/z958McQMSONIab/CgLvfenrYc38ErjKstdovyduYs905aVitlUk19dOiH35qJgeFl9+6zNWIOB4OysWsBmdnmtbk1avM/v/Ove3bJvcE=
- secure: mk2cdXuMTQKL3bIyFsE+dAmxHN5PvKKptPhsV4TjeBq7nYGqchnfUNRhRabCZNj7FpRP5G8CyXmWWb9RQX8gYzlEAjD+XIOPB2PX1+nphaWRjoInXIVFFzHzAb5tVdrvO/NVAdd9dbFqq7Eoj4QrS+5bRR8V/NtK1TFfsOyWFgY=
#!/bin/bash -x
git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
if ! (git remote set-branches --add origin gh-pages && git fetch -q); then
echo "No gh-pages, so not syncing"
exit 0
fi
if ! [ -d target/generated-docs ]; then
echo "No gh-pages sources in target/generated-docs, so not syncing"
exit 0
fi
# Stash any outstanding changes
###################################################################
git diff-index --quiet HEAD
dirty=$?
if [ "$dirty" != "0" ]; then git stash; fi
# Switch to gh-pages branch to sync it with master
###################################################################
git checkout gh-pages
for f in target/generated-docs/*; do
file=${f#target/generated-docs/*}
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
# Not ignored...
cp -rf $f .
git add -A $file
fi
done
git commit -a -m "Sync docs from master to gh-pages"
# Uncomment the following push if you want to auto push to
# the gh-pages branch whenever you commit to master locally.
# This is a little extreme. Use with care!
###################################################################
git push origin gh-pages
# Finally, switch back to the master branch and exit block
git checkout master
if [ "$dirty" != "0" ]; then git stash pop; fi
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment