|
|
|
@ -1,29 +1,29 @@ |
|
|
|
|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
|
if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then |
|
|
|
|
echo "Skipping phpDoc deployment because this is not on the required runtime" |
|
|
|
|
echo "Skipping branch deployment because this is not on the required runtime" |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [[ ",$DEPLOY_PHPDOC_BRANCHES," != *,"$TRAVIS_BRANCH",* ]]; then |
|
|
|
|
echo "Skipping phpDoc deployment because this branch ($TRAVIS_BRANCH) is not permitted to deploy" |
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then |
|
|
|
|
echo "Skipping branch deployment because this pull request (#$TRAVIS_PULL_REQUEST) is not permitted to deploy" |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then |
|
|
|
|
echo "Skipping phpDoc deployment because this pull request (#$TRAVIS_PULL_REQUEST) is not permitted to deploy" |
|
|
|
|
if [[ ",$DEPLOY_PHPDOC_BRANCHES," != *,"$TRAVIS_BRANCH",* ]]; then |
|
|
|
|
echo "Skipping phpDoc branch deployment because this branch ($TRAVIS_BRANCH) is not permitted to deploy" |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
PHPDOC_ID="${TRAVIS_BRANCH//\//_}" |
|
|
|
|
PHPDOC_GIT_DIR="$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID.git" |
|
|
|
|
DEPLOYMENT_ID="${TRAVIS_BRANCH//\//_}" |
|
|
|
|
DEPLOYMENT_DIR="$TRAVIS_BUILD_DIR/_build/deploy-$DEPLOYMENT_ID.git" |
|
|
|
|
|
|
|
|
|
# clone repo |
|
|
|
|
echo "Cloning repo..." |
|
|
|
|
git clone --branch="gh-pages" "https://github.com/$TRAVIS_REPO_SLUG.git" "$PHPDOC_GIT_DIR" |
|
|
|
|
git clone --branch="gh-pages" "https://github.com/$TRAVIS_REPO_SLUG.git" "$DEPLOYMENT_DIR" |
|
|
|
|
[ $? -eq 0 ] || exit 1 |
|
|
|
|
|
|
|
|
|
cd "$PHPDOC_GIT_DIR" |
|
|
|
|
cd "$DEPLOYMENT_DIR" |
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
# setup repo |
|
|
|
@ -32,17 +32,17 @@ github-setup.sh |
|
|
|
|
# generate phpDocs |
|
|
|
|
generate-phpdoc.sh \ |
|
|
|
|
"$TRAVIS_BUILD_DIR/.phpdoc.xml" \ |
|
|
|
|
"$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID.cache" "$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID" \ |
|
|
|
|
"$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID.cache" "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID" \ |
|
|
|
|
"Pico 1.0 API Documentation ($TRAVIS_BRANCH branch)" |
|
|
|
|
[ $? -eq 0 ] || exit 1 |
|
|
|
|
[ -n "$(git status --porcelain "$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID.cache")" ] || exit 0 |
|
|
|
|
[ -n "$(git status --porcelain "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID.cache")" ] || exit 0 |
|
|
|
|
|
|
|
|
|
# commit phpDocs |
|
|
|
|
echo "Committing changes..." |
|
|
|
|
git add "$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID.cache" "$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID" |
|
|
|
|
git add "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID.cache" "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID" |
|
|
|
|
git commit \ |
|
|
|
|
--message="Update phpDocumentor class docs for $TRAVIS_BRANCH branch @ $TRAVIS_COMMIT" \ |
|
|
|
|
"$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID.cache" "$PHPDOC_GIT_DIR/phpDoc/$PHPDOC_ID" |
|
|
|
|
"$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID.cache" "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID" |
|
|
|
|
[ $? -eq 0 ] || exit 1 |
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|