phpDocs auto deployment: Remove pull requests support

We can deploy phpDocs in safe environments only, but "safe environment" is equivalent to "pull a local branch", therefore we can simply use that local branch to deploy the phpDocs. There's no need for a explicit pull request support.
This commit is contained in:
Daniel Rudolf 2015-11-26 04:06:34 +01:00
parent 8005efdbbb
commit 54305c4d33
2 changed files with 6 additions and 21 deletions

View file

@ -10,32 +10,19 @@ if [[ ",$DEPLOY_PHPDOC_BRANCHES," != *,"$TRAVIS_BRANCH",* ]]; then
exit
fi
if [ "$TRAVIS_SECURE_ENV_VARS" != "true" ]; then
echo "Skipping phpDoc deployment because this is no environment with write access to the repository"
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping phpDoc deployment because this pull request (#$TRAVIS_PULL_REQUEST) is not permitted to deploy"
exit
fi
PHPDOC_ID="${TRAVIS_BRANCH//\//_}"
PHPDOC_REF="heads/$TRAVIS_BRANCH @ $TRAVIS_COMMIT"
PHPDOC_REF_TEXT="$TRAVIS_BRANCH branch"
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
PHPDOC_ID="pull_$TRAVIS_PULL_REQUEST"
PHPDOC_REF="pull/$TRAVIS_PULL_REQUEST/head"
PHPDOC_REF_TEXT="pull request #$TRAVIS_PULL_REQUEST"
if [[ ",$DEPLOY_PHPDOC_BRANCHES," != *,"#$TRAVIS_PULL_REQUEST",* ]]; then
echo "Skipping phpDoc deployment because this pull request (#$TRAVIS_PULL_REQUEST) is not permitted to deploy"
exit
fi
fi
generate-phpdoc.sh \
"$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \
"Pico 1.0 API Documentation ($PHPDOC_REF_TEXT)"
"Pico 1.0 API Documentation ($TRAVIS_BRANCH branch)"
[ $? -eq 0 ] || exit 1
deploy-phpdoc.sh \
"$TRAVIS_REPO_SLUG" "$PHPDOC_REF" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \
"$TRAVIS_REPO_SLUG" "heads/$TRAVIS_BRANCH @ $TRAVIS_COMMIT" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \
"$TRAVIS_REPO_SLUG" "gh-pages" "phpDoc/$PHPDOC_ID"
[ $? -eq 0 ] || exit 1

View file

@ -3,15 +3,13 @@
[ "$DEPLOY_PHPDOC_RELEASES" == "true" ] || exit
PHPDOC_ID="${TRAVIS_BRANCH//\//_}"
PHPDOC_REF="tags/$TRAVIS_TAG"
PHPDOC_REF_TEXT="$TRAVIS_TAG"
generate-phpdoc.sh \
"$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \
"Pico 1.0 API Documentation ($PHPDOC_REF_TEXT)"
"Pico 1.0 API Documentation ($TRAVIS_TAG)"
[ $? -eq 0 ] || exit 1
deploy-phpdoc.sh \
"$TRAVIS_REPO_SLUG" "$PHPDOC_REF" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \
"$TRAVIS_REPO_SLUG" "tags/$TRAVIS_TAG" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \
"$TRAVIS_REPO_SLUG" "gh-pages" "phpDoc/$PHPDOC_ID"
[ $? -eq 0 ] || exit 1