Pico/_build/deploy-phpdoc-branch.sh

41 lines
1.2 KiB
Bash
Raw Normal View History

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