Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. VERSION=""
  2. REMOTE="origin"
  3. ALL: help
  4. .PHONY: help install test bump-version tag-version
  5. help:
  6. @echo "CakePHP Makefile"
  7. @echo "================"
  8. @echo ""
  9. @echo "release"
  10. @echo " Create a new release of CakePHP. Requires the VERSION parameter."
  11. @echo " Packages up a new app skeleton tarball and uploads it to github."
  12. @echo ""
  13. @echo "test"
  14. @echo " Run the tests for CakePHP."
  15. @echo ""
  16. @echo "bump-version"
  17. @echo " Bumps the version to VERSION"
  18. # Download composer
  19. composer.phar:
  20. curl -sS https://getcomposer.org/installer | php
  21. # Install dependencies
  22. install: composer.phar
  23. php composer.phar install
  24. test: install
  25. vendor/bin/phpunit
  26. # Update VERSION.txt to new version.
  27. bump-version:
  28. @if [ $(VERSION) = "" ]; \
  29. then \
  30. echo "You must specify a version to bump to."; \
  31. exit 1; \
  32. fi;
  33. @echo "Update VERSION.txt to $(VERSION)"
  34. # Work around bash being bad.
  35. mv VERSION.txt VERSION.old
  36. cat VERSION.old | sed s'/^[0-9]\.[0-9]\.[0-9].*/$(VERSION)/' > VERSION.txt
  37. rm VERSION.old
  38. git add VERSION.txt
  39. git commit -m "Update version number to $(VERSION)"
  40. # Tag a release
  41. tag-release: bump-version
  42. @echo "Tagging $(VERSION)"
  43. git tag -s $(VERSION) -m "CakePHP $(VERSION)"
  44. git push $(REMOTE)
  45. git push $(REMOTE) --tags