deploy-phpdoc-release.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env bash
  2. [ "$DEPLOY_PHPDOC_RELEASES" == "true" ] || exit
  3. PHPDOC_ID="${TRAVIS_BRANCH//\//_}"
  4. GIT_DIR="$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID.git"
  5. # clone repo
  6. echo "Cloning repo..."
  7. git clone --branch="gh-pages" "https://github.com/$TRAVIS_REPO_SLUG.git" "$GIT_DIR"
  8. [ $? -eq 0 ] || exit 1
  9. cd "$GIT_DIR"
  10. echo
  11. # setup repo
  12. github-setup.sh
  13. # generate phpDocs
  14. generate-phpdoc.sh \
  15. "$TRAVIS_BUILD_DIR/.phpdoc.xml" \
  16. "-" "$GIT_DIR/phpDoc/$PHPDOC_ID" \
  17. "Pico 1.0 API Documentation ($TRAVIS_TAG)"
  18. [ $? -eq 0 ] || exit 1
  19. # commit phpDocs
  20. echo "Committing changes..."
  21. git add "$GIT_DIR/phpDoc/$PHPDOC_ID"
  22. git commit \
  23. --message="Update phpDocumentor class docs for $TRAVIS_TAG" \
  24. "$GIT_DIR/phpDoc/$PHPDOC_ID"
  25. [ $? -eq 0 ] || exit 1
  26. echo
  27. # update version badge
  28. gnerate-badge.sh \
  29. "$GIT_DIR/badges/pico-version.svg" \
  30. "release" "v$TRAVIS_TAG" "blue"
  31. # commit version badge
  32. git add "$GIT_DIR/badges/pico-version.svg"
  33. git commit \
  34. --message="Update version badge for $TRAVIS_TAG" \
  35. "$GIT_DIR/badges/pico-version.svg"
  36. # deploy
  37. github-deploy.sh "$TRAVIS_REPO_SLUG" "tags/$TRAVIS_TAG" "$TRAVIS_COMMIT"
  38. [ $? -eq 0 ] || exit 1