diff options
author | Fabian Becker <halfdan@xnorfz.de> | 2013-03-16 00:39:42 +0400 |
---|---|---|
committer | Fabian Becker <halfdan@xnorfz.de> | 2013-03-16 00:39:42 +0400 |
commit | 8fea50c1f47ce53029446d0e0d85a14a417590ad (patch) | |
tree | 45e7b75a6ae83570f888526fe34923ca9b49c95c | |
parent | fd1d5ec4b82af64b0a75b91c268b4a51d813bbbf (diff) |
Added script to automatically
- install phpdoc if not found
- generate docs for PiwikTracker
- upload via FTP to docs.piwik.org
[ci skip]
-rwxr-xr-x | tests/travis/generate_docs.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/travis/generate_docs.sh b/tests/travis/generate_docs.sh new file mode 100755 index 0000000000..ed5834452b --- /dev/null +++ b/tests/travis/generate_docs.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# If there is no FTPPASS available +# we don't build the documentation +if [ -z "$FTPPASS" ] +then + exit 0 +fi + +# Install phpdoc +install_phpdoc(){ + echo "Installing phpdoc" + pyrus channel-discover pear.phpdoc.org + pyrus install phpdoc/phpDocumentor-alpha +} + +command -v phpdoc > /dev/null 2>&1 || { install_phpdoc; } + +# Rehash phpenv so phpdoc binary is picked up +phpenv rehash + +# Generate phpdoc for PiwikTracker +echo "Generate documentation for PiwikTracker" +phpdoc -f libs/PiwikTracker/PiwikTracker.php --title="PiwikTracker" -t docs/PiwikTracker/ + +# Install lftp +echo "Installing lftp" +sudo apt-get install lftp + +# Upload generated docs via FTP +echo "Upload generated docs" +lftp -u piwik-docs,$FTPPASS ftp.piwik.org -e "set ftp:ssl-allow no; set net:max-retries 1; mirror -R docs/PiwikTracker www/PiwikTracker; quit" |