Makefile 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. SHELL := /usr/bin/env bash
  2. args = `arg="$(filter-out $(firstword $(MAKECMDGOALS)),$(MAKECMDGOALS))" && echo $${arg:-${1}}`
  3. green = $(shell printf "\e[32;01m$1\e[0m")
  4. yellow = $(shell printf "\e[33;01m$1\e[0m")
  5. red = $(shell printf "\e[33;31m$1\e[0m")
  6. format = $(shell printf "%-40s %s" "$(call green,bin/$1)" $2)
  7. comma:= ,
  8. .DEFAULT_GOAL:=help
  9. %:
  10. @:
  11. help:
  12. @echo ""
  13. @echo "$(call yellow,Use the following CLI commands:)"
  14. @echo "$(call red,===============================)"
  15. @echo "$(call format,analyse,'Run `phpstan analyse` within the container to statically analyse code, passing in directory to analyse.')"
  16. @echo "$(call format,bash,'Drop into the bash prompt of your Docker container.')"
  17. @echo "$(call format,blackfire,'Disable or enable Blackfire. Accepts argument `disable`, `enable`, or `status`.')"
  18. @echo "$(call format,cache-clean,'Access the cache-clean CLI.')"
  19. @echo "$(call format,check-dependencies,'Provides helpful recommendations for dependencies.')"
  20. @echo "$(call format,cli,'Run any CLI command without going into the bash prompt.')"
  21. @echo "$(call format,clinotty,'Run any CLI command with no TTY.')"
  22. @echo "$(call format,cliq,'Run any CLI command but pipe all output to /dev/null.')"
  23. @echo "$(call format,composer,'Run the composer binary.')"
  24. @echo "$(call format,configure-linux`,'Adds the Docker container IP address to /etc/hosts if not already present. Optionally enables port 9003 for Xdebug')"
  25. @echo "$(call format,copyfromcontainer,'Copy folders or files from container to host.')"
  26. @echo "$(call format,copytocontainer,'Copy folders or files from host to container.')"
  27. @echo "$(call format,create-user,'Create either an admin user or customer account.')"
  28. @echo "$(call format,cron,'Start or stop the cron service.')"
  29. @echo "$(call format,debug-cli,'Enable Xdebug for bin/magento, with an optional argument of the IDE key. Defaults to PHPSTORM.')"
  30. @echo "$(call format,deploy,'Runs the standard Magento deployment process commands. Pass extra locales besides `en_US` via an optional argument.')"
  31. @echo "$(call format,dev-test-run,' Facilitates running PHPUnit tests for a specified test type.')"
  32. @echo "$(call format,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
  33. @echo "$(call format,devconsole,'Alias for n98-magerun2 dev:console.')"
  34. @echo "$(call format,docker-compose,'Support V1 (`docker-compose`) and V2 (`docker compose`) docker compose command, and use custom configuration files.')"
  35. @echo "$(call format,docker-start,'Start the Docker application (either Orbstack or Docker Desktop)"
  36. @echo "$(call format,docker-stats,'Display status for CPU$(comma) memory usage$(comma) and memory limit of currently-running Docker containers.')"
  37. @echo "$(call format,download,'Download & extract specific Magento version to the src directory.')"
  38. @echo "$(call format,ece-patches,'Run the Cloud Patches CLI.')"
  39. @echo "$(call format,fixowns,'This will fix filesystem ownerships within the container.')"
  40. @echo "$(call format,fixperms,'This will fix filesystem permissions within the container.')"
  41. @echo "$(call format,grunt,'Run the grunt binary.')"
  42. @echo "$(call format,install-php-extensions,'Install PHP extension in the container.')"
  43. @echo "$(call format,log,'Monitor the Magento log files. Pass no params to tail all files.')"
  44. @echo "$(call format,magento,'Run the Magento CLI.')"
  45. @echo "$(call format,magento-version,'Determine the Magento version installed in the current environment..')"
  46. @echo "$(call format,mftf,'Run the Magento MFTF.')"
  47. @echo "$(call format,mysql,'Run the MySQL CLI with database config from env/db.env.')"
  48. @echo "$(call format,mysqldump,'Backup the Magento database.')"
  49. @echo "$(call format,n98-magerun2,'Access the n98-magerun2 CLI.')"
  50. @echo "$(call format,node,'Run the node binary.')"
  51. @echo "$(call format,npm,'Run the npm binary.')"
  52. @echo "$(call format,phpcbf,'Auto-fix PHP_CodeSniffer errors with Magento2 options.')"
  53. @echo "$(call format,phpcs,'Run PHP_CodeSniffer with Magento2 options.')"
  54. @echo "$(call format,phpcs-json-report,'Run PHP_CodeSniffer with Magento2 options and save to `report.json` file.')"
  55. @echo "$(call format,pwa-studio,'(BETA) Start the PWA Studio server.')"
  56. @echo "$(call format,redis,'Run a command from the redis container.')"
  57. @echo "$(call format,remove,'Remove all containers.')"
  58. @echo "$(call format,removeall,'Remove all containers$(comma) networks$(comma) volumes and images.')"
  59. @echo "$(call format,removenetwork,'Remove a network associated with the current directory name.')"
  60. @echo "$(call format,removevolumes,'Remove all volumes.')"
  61. @echo "$(call format,restart,'Stop and then start all containers.')"
  62. @echo "$(call format,root,'Run any CLI command as root without going into the bash prompt.')"
  63. @echo "$(call format,rootnotty,'Run any CLI command as root with no TTY.')"
  64. @echo "$(call format,setup,'Run the Magento setup process$(comma) with optional domain name.')"
  65. @echo "$(call format,setup-composer-auth,'Setup authentication credentials for Composer.')"
  66. @echo "$(call format,setup-domain,'Setup Magento domain name.')"
  67. @echo "$(call format,setup-grunt,'Install and configure Grunt JavaScript task runner.')"
  68. @echo "$(call format,setup-install,'Automates the installation process for a Magento instance.')"
  69. @echo "$(call format,setup-integration-tests,'Script to set up integration tests.')"
  70. @echo "$(call format,setup-pwa-studio,'(BETA) Install PWA Studio.')"
  71. @echo "$(call format,setup-pwa-studio-sampledata,'This script makes it easier to install Venia sample data.')"
  72. @echo "$(call format,setup-ssl,'Generate an SSL certificate for one or more domains.')"
  73. @echo "$(call format,setup-ssl-ca,'Generate a certificate authority and copy it to the host.')"
  74. @echo "$(call format,spx,'Disable or enable output compression to enable or disbale SPX.')"
  75. @echo "$(call format,start,'Start all containers.')"
  76. @echo "$(call format,status,'Check the container status.')"
  77. @echo "$(call format,stop,'Stop all project containers.')"
  78. @echo "$(call format,stopall,'Stop all docker running containers.')"
  79. @echo "$(call format,test,'Run unit tests for a specific path.')"
  80. @echo "$(call format,update,'Update your project to the latest version of docker-magento.')"
  81. @echo "$(call format,xdebug,'Set a custom xdebug.mode, or check the current status and get all available modes . Accepts optional argument of mode `off`, `debug`, etc.')"
  82. analyse:
  83. @./bin/analyse $(call args)
  84. bash:
  85. @./usr/bin/env bash
  86. cache-clean:
  87. @./bin/cache-clean $(call args)
  88. check-dependencies:
  89. @./bin/check-dependencies
  90. cli:
  91. @./bin/cli $(call args)
  92. clinotty:
  93. @./bin/clinotty $(call args)
  94. cliq:
  95. @./bin/cliq $(call args)
  96. composer:
  97. @./bin/composer $(call args)
  98. configure-linux:
  99. @./bin/configure-linux
  100. copyfromcontainer:
  101. @./bin/copyfromcontainer $(call args)
  102. copytocontainer:
  103. @./bin/copytocontainer $(call args)
  104. cron:
  105. @./bin/cron $(call args)
  106. debug-cli:
  107. @./bin/debug-cli $(call args)
  108. deploy:
  109. @./bin/deploy $(call args)
  110. dev-test-run:
  111. @./bin/dev-test-run
  112. dev-urn-catalog-generate:
  113. @./bin/dev-urn-catalog-generate
  114. devconsole:
  115. @./bin/devconsole
  116. docker-compose:
  117. @./bin/docker-compose
  118. docker-stats:
  119. @./bin/docker-stats
  120. download:
  121. @./bin/download $(call args)
  122. fixowns:
  123. @./bin/fixowns $(call args)
  124. fixperms:
  125. @./bin/fixperms $(call args)
  126. grunt:
  127. @./bin/grunt $(call args)
  128. install-php-extensions:
  129. @./bin/install-php-extensions $(call args)
  130. log:
  131. @./bin/log $(call args)
  132. magento:
  133. @./bin/magento $(call args)
  134. magento-version:
  135. @./bin/magento-version
  136. mftf:
  137. @./bin/mftf $(call args)
  138. mysql:
  139. @./bin/mysql $(call args)
  140. mysqldump:
  141. @./bin/mysqldump $(call args)
  142. n98-magerun2:
  143. @./bin/n98-magerun2 $(call args)
  144. node:
  145. @./bin/node $(call args)
  146. npm:
  147. @./bin/npm $(call args)
  148. phpcbf:
  149. @./bin/phpcbf $(call args)
  150. phpcs:
  151. @./bin/phpcs $(call args)
  152. phpcs-json-report:
  153. @./bin/phpcs-json-report $(call args)
  154. pwa-studio:
  155. @./bin/pwa-studio
  156. redis:
  157. @./bin/redis $(call args)
  158. remove:
  159. @./bin/remove
  160. removeall:
  161. @./bin/removeall
  162. removenetwork:
  163. @./bin/removenetwork
  164. removevolumes:
  165. @./bin/removevolumes
  166. restart:
  167. @./bin/restart $(call args)
  168. root:
  169. @./bin/root $(call args)
  170. rootnotty:
  171. @./bin/rootnotty $(call args)
  172. setup:
  173. @./bin/setup $(call args)
  174. setup-composer-auth:
  175. @./bin/setup-composer-auth
  176. setup-domain:
  177. @./bin/setup-domain $(call args)
  178. setup-grunt:
  179. @./bin/setup-grunt
  180. setup-install:
  181. @./bin/setup-install $(call args)
  182. setup-integration-tests:
  183. @./bin/setup-integration-tests
  184. setup-pwa-studio:
  185. @./bin/setup-pwa-studio $(call args)
  186. setup-pwa-studio-sampledata:
  187. @./bin/setup-pwa-studio-sampledata $(call args)
  188. setup-ssl:
  189. @./bin/setup-ssl $(call args)
  190. setup-ssl-ca:
  191. @./bin/setup-ssl-ca
  192. spx:
  193. @./bin/spx $(call args)
  194. start:
  195. @./bin/start $(call args)
  196. status:
  197. @./bin/status
  198. stop:
  199. @./bin/stop $(call args)
  200. stopall:
  201. @./bin/stopall $(call args)
  202. update:
  203. @./bin/update
  204. xdebug:
  205. @./bin/xdebug $(call args)