From a62a58afc3b6d0230ddab40679f09107d4c2d106 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Sun, 4 May 2014 12:21:19 +0200 Subject: [PATCH 1/3] #154 : PHPDocumentor on GH-Pages --- .travis_shell_after_success.sh | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .travis_shell_after_success.sh diff --git a/.travis_shell_after_success.sh b/.travis_shell_after_success.sh new file mode 100644 index 00000000..de2f366a --- /dev/null +++ b/.travis_shell_after_success.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +echo "--DEBUG--" +echo "TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG" +echo "TRAVIS_PHP_VERSION: $TRAVIS_PHP_VERSION" +echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST" + +if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/PHPWord" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then + + echo -e "Publishing PHPDoc...\n" + + cp -R build/docs $HOME/docs-latest + + cd $HOME + git config --global user.email "travis@travis-ci.org" + git config --global user.name "travis-ci" + git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Progi1984/YATSPHP gh-pages > /dev/null + + cd gh-pages + echo "--DEBUG : Suppression" + git rm -rf ./docs/$TRAVIS_BRANCH + + echo "--DEBUG : Dossier" + mkdir docs + cd docs + mkdir $TRAVIS_BRANCH + + echo "--DEBUG : Copie" + cp -Rf $HOME/docs-latest/* ./$TRAVIS_BRANCH/ + + echo "--DEBUG : Git" + git add -f . + git commit -m "PHPDocumentor (Travis Build : $TRAVIS_BUILD_NUMBER - Branch : $TRAVIS_BRANCH)" + git push -fq origin gh-pages > /dev/null + + echo -e "Published PHPDoc to gh-pages.\n" + +fi From a5287ac705cb8b4e2b67a846fbad2be3ae4808e3 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Sun, 4 May 2014 12:22:55 +0200 Subject: [PATCH 2/3] #154 : PHPDocumentor on GH-Pages --- .travis.yml | 14 +++++++++++++- composer.json | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad3df613..d6d5ddd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,17 @@ matrix: - php: 5.6 - php: hhvm +env: + global: + - secure: "Sq+6bVtnPsu0mWX8DWQ+9bGAjxMcGorksUiHc4YIXEJsuDfVmVlH8tTD547IeCjDAx9MxXerZ2Z4HSjxTB70VEnJPvZMHI/EZn4Ny31YLHEthdZbV5Gd1h0TGp8VOzPKGShvGrtGBX6MvMfgpK4zuieVWbSfdKeecm8ZNLMpUd4=" + before_script: ## Composer # - curl -s http://getcomposer.org/installer | php # - php composer.phar install --prefer-source - composer self-update - composer require dompdf/dompdf:0.6.* - - composer install --prefer-source + - composer install --prefer-source --dev ## PHP_CodeSniffer - pyrus install pear/PHP_CodeSniffer - phpenv rehash @@ -35,6 +39,8 @@ before_script: #- phpenv rehash ## PHPLOC #- curl -o phploc.phar https://phar.phpunit.de/phploc.phar + ## PHPDocumentor + - mkdir -p build/docs script: ## PHP_CodeSniffer @@ -48,3 +54,9 @@ script: #- php phploc.phar src/ ## PHPUnit - phpunit -c ./ --coverage-text + ## PHPDocumentor + - vendor/bin/phpdoc.php -d ./src -t ./build/docs + +after_script: + ## PHPDocumentor + - bash .travis_shell_after_success.sh diff --git a/composer.json b/composer.json index fafa9a28..a8c83abd 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,8 @@ "ext-zip": "*" }, "require-dev": { - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "3.7.*", + "phpdocumentor/phpdocumentor":"2.*" }, "suggest": { "ext-gd2": "Required to add images", From de2b7d897cd5c99abfc5ef65a47fe8e5d2709304 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Sun, 4 May 2014 12:34:35 +0200 Subject: [PATCH 3/3] #154 : PHPDocumentor on GH-Pages --- .travis_shell_after_success.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis_shell_after_success.sh b/.travis_shell_after_success.sh index de2f366a..567b1acb 100644 --- a/.travis_shell_after_success.sh +++ b/.travis_shell_after_success.sh @@ -14,7 +14,7 @@ if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/PHPWord" ] && [ "$TRAVIS_PULL_REQUEST" == cd $HOME git config --global user.email "travis@travis-ci.org" git config --global user.name "travis-ci" - git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Progi1984/YATSPHP gh-pages > /dev/null + git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/PHPOffice/PHPWord gh-pages > /dev/null cd gh-pages echo "--DEBUG : Suppression"