theshka пре 9 година
родитељ
комит
f062640bb1
3 измењених фајлова са 44 додато и 1 уклоњено
  1. 10 1
      .travis.yml
  2. 31 0
      build/gh-pages.sh
  3. 3 0
      composer.json

+ 10 - 1
.travis.yml

@@ -12,7 +12,17 @@ script:
   - find . -type f -name '*.php' -print0 | xargs -0 -I file php -l file > /dev/null
 
 before_deploy:
+  #update composer
+  - composer self-update
+  # install dependencies + req-dev
   - composer install
+  # Generate API documentation
+  - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then php vendor/bin/phpdoc -d $TRAVIS_BUILD_DIR -t $TRAVIS_BUILD_DIR/build/docs/$TRAVIS_TAG ; fi"
+  # Send documentation to Github Pages
+  - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then cd build/docs; bash ../gh-pages.sh; fi"
+  # remove req-dev depenedencies
+  - composer update --no-dev
+  # package Pico
   - tar -czf "pico-release-$TRAVIS_TAG.tar.gz" .htaccess README.md CHANGELOG.md CONTRIBUTING.md composer.json composer.lock LICENSE config content-sample lib plugins themes vendor index.php
 
 deploy:
@@ -26,4 +36,3 @@ deploy:
     php: 5.3
 
 sudo: false
-

+ 31 - 0
build/gh-pages.sh

@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+#
+# https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
+#
+
+# Exit with nonzero exit code if anything fails
+set -e
+
+# Clone Pico, then create & checkout gh-pages branch
+git clone -b gh-pages "https://github.com/theshka/Pico.git"
+
+# Inside this git repo we'll pretend to be a new user
+git config user.name "theshka"
+git config user.email "tyler@heshka.com"
+
+#move old files
+mv $TRAVIS_BUILD_DIR/Pico/phpDoc/master $TRAVIS_BUILD_DIR/Pico/phpDoc/old-stable
+#move new files
+cp $TRAVIS_BUILD_DIR/build/docs/$TRAVIS_TAG $TRAVIS_BUILD_DIR/Pico/phpDoc/master
+
+# Add the files to our commit
+git add $TRAVIS_BUILD_DIR/Pico/phpDoc/*
+
+# Commit the files with our commit message
+git commit -m "update documentation"
+
+# Force push from the current repo's master branch to the remote
+# repo's gh-pages branch.We redirect any output to
+# /dev/null to hide any sensitive credential data that might otherwise be exposed.
+#git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
+git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1

+ 3 - 0
composer.json

@@ -17,6 +17,9 @@
         "erusev/parsedown-extra": "0.7.*",
         "symfony/yaml" : "2.3"
     },
+    "require-dev" : {
+        "phpdocumentor/phpdocumentor": "2.*"
+    },
     "autoload": {
         "psr-0": {
             "Pico": "lib/",