# # This Makefile functions both as an easy way to issue # some common but easy to forget commands for this # project, while also serving as something of a cheat- # sheet for those same commands. Use this Makefile # if you want, or just use it as a reference. # # To use one of the commands in this Makefile, simply # type something like # # make autoload # # or # # make routeclear # # make is a standard software development tool, though # a bit "old-school." But you should be able to find # man files or other documentation for it easily. #========================================================== # Displays the versions of software used for this project .PHONY: versions versions: rpm --query redhat-release composer -V php artisan --version echo "Mysql 8.0.25" #========================================================== # Displays a simple help file for this Makefile .PHONY: help help: grep -A 1 -B 1 ".PHONY" Makefile | grep -v ".PHONY" #========================================================== # Runs a local server for testing purposes on localhost:8000 .PHONY: serve serve: php artisan serve #========================================================== # Run this when a new namespace is added .PHONY: start autoload: composer dump-autoload #========================================================== # Clears existing routing after you edit routes .PHONY: routeclear routeclear: php artisan route:clear #========================================================== # Clears artisan's cache. Or something. .PHONY: cacheclear cacheclear: php artisan cache:clear #========================================================== # Run this series of commands after you deploy new code .PHONY: postdeploy postdeploy: php artisan route:clear php artisan config:clear php artisan cache:clear composer dump-autoload sudo /usr/local/bin/fix-web-perms.sh #========================================================== # Run unit tests built for phpunit .PHONY: test test: php ./vendor/bin/phpunit #========================================================== # In case I mistakenly type "make tests" instead of test .PHONY: tests tests: test #========================================================== # This target creates a unit test for this project. Usage: # # make testname= createtest # # Note that the class name must end in Test for it to work. # Also, --unit tells the test creation to create the test # in the tests/Unit directory. (New tests are created in # either Unit or Feature, and it's a hassle to override that # obnoxious behavior.) # # Creates a new unit test .PHONY: createtest createtest: php artisan make:test --unit $(testname) #========================================================== # When developers work on code, the source file might be # saved with permissions that the web server can't read. # Running this script will fix up those permissions in # most cases. # # Corrects the permissions for this project .PHONY: fixperms fixperms: sudo /usr/local/bin/fix-web-perms.sh #========================================================== # Restarts the web server / httpd .PHONY: restart restart: sudo /sbin/service httpd restart