travis_push_doc.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. set -ev
  3. # This script will only be executed on branches which are either master or a release
  4. # See travis_linux_after_success.sh
  5. # The encrypted key is not available in pull requests from forks
  6. if [ -z "$GITAUTH" ]; then
  7. exit 0
  8. fi
  9. git clone --depth=5 -b gh-pages https://$GITAUTH@github.com/open62541/open62541-www
  10. cd open62541-www
  11. target_dir="${TRAVIS_BRANCH}"
  12. if [ "${TRAVIS_BRANCH}" = "master" ]; then
  13. target_dir="current"
  14. fi
  15. echo "=== Pushing doc for ${target_dir} ==="
  16. rm -r -f ./doc/${target_dir} || true # ignore result
  17. mkdir ./doc/${target_dir} || true # ignore result
  18. cp -r ../../doc/* ./doc/${target_dir}/
  19. cp -r ../../doc_latex/open62541.pdf ./doc/open62541-${target_dir}.pdf
  20. git add -A ./doc
  21. git config --global user.email "open62541-travis-ci@users.noreply.github.com"
  22. git config --global user.name "Open62541 travis-ci"
  23. git config --global push.default simple
  24. git commit -am "updated generated documentation on webpage by travis-ci [ci skip]"
  25. git push https://$GITAUTH@github.com/open62541/open62541-www
  26. cd .. && rm -rf open62541-www