2
0

Makefile 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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-stats,'Display status for CPU$(comma) memory usage$(comma) and memory limit of currently-running Docker containers.')"
  36. @echo "$(call format,download,'Download & extract specific Magento version to the src directory.')"
  37. @echo "$(call format,ece-patches,'Run the Cloud Patches CLI.')"
  38. @echo "$(call format,fixowns,'This will fix filesystem ownerships within the container.')"
  39. @echo "$(call format,fixperms,'This will fix filesystem permissions within the container.')"
  40. @echo "$(call format,grunt,'Run the grunt binary.')"
  41. @echo "$(call format,install-php-extensions,'Install PHP extension in the container.')"
  42. @echo "$(call format,log,'Monitor the Magento log files. Pass no params to tail all files.')"
  43. @echo "$(call format,magento,'Run the Magento CLI.')"
  44. @echo "$(call format,magento-version,'Determine the Magento version installed in the current environment..')"
  45. @echo "$(call format,mftf,'Run the Magento MFTF.')"
  46. @echo "$(call format,mysql,'Run the MySQL CLI with database config from env/db.env.')"
  47. @echo "$(call format,mysqldump,'Backup the Magento database.')"
  48. @echo "$(call format,n98-magerun2,'Access the n98-magerun2 CLI.')"
  49. @echo "$(call format,node,'Run the node binary.')"
  50. @echo "$(call format,npm,'Run the npm binary.')"
  51. @echo "$(call format,phpcbf,'Auto-fix PHP_CodeSniffer errors with Magento2 options.')"
  52. @echo "$(call format,phpcs,'Run PHP_CodeSniffer with Magento2 options.')"
  53. @echo "$(call format,phpcs-json-report,'Run PHP_CodeSniffer with Magento2 options and save to `report.json` file.')"
  54. @echo "$(call format,pwa-studio,'(BETA) Start the PWA Studio server.')"
  55. @echo "$(call format,redis,'Run a command from the redis container.')"
  56. @echo "$(call format,remove,'Remove all containers.')"
  57. @echo "$(call format,removeall,'Remove all containers$(comma) networks$(comma) volumes and images.')"
  58. @echo "$(call format,removenetwork,'Remove a network associated with the current directory name.')"
  59. @echo "$(call format,removevolumes,'Remove all volumes.')"
  60. @echo "$(call format,restart,'Stop and then start all containers.')"
  61. @echo "$(call format,root,'Run any CLI command as root without going into the bash prompt.')"
  62. @echo "$(call format,rootnotty,'Run any CLI command as root with no TTY.')"
  63. @echo "$(call format,setup,'Run the Magento setup process$(comma) with optional domain name.')"
  64. @echo "$(call format,setup-composer-auth,'Setup authentication credentials for Composer.')"
  65. @echo "$(call format,setup-domain,'Setup Magento domain name.')"
  66. @echo "$(call format,setup-grunt,'Install and configure Grunt JavaScript task runner.')"
  67. @echo "$(call format,setup-install,'Automates the installation process for a Magento instance.')"
  68. @echo "$(call format,setup-integration-tests,'Script to set up integration tests.')"
  69. @echo "$(call format,setup-pwa-studio,'(BETA) Install PWA Studio.')"
  70. @echo "$(call format,setup-pwa-studio-sampledata,'This script makes it easier to install Venia sample data.')"
  71. @echo "$(call format,setup-ssl,'Generate an SSL certificate for one or more domains.')"
  72. @echo "$(call format,setup-ssl-ca,'Generate a certificate authority and copy it to the host.')"
  73. @echo "$(call format,spx,'Disable or enable output compression to enable or disbale SPX.')"
  74. @echo "$(call format,start,'Start all containers.')"
  75. @echo "$(call format,status,'Check the container status.')"
  76. @echo "$(call format,stop,'Stop all project containers.')"
  77. @echo "$(call format,stopall,'Stop all docker running containers.')"
  78. @echo "$(call format,test,'Run unit tests for a specific path.')"
  79. @echo "$(call format,update,'Update your project to the latest version of docker-magento.')"
  80. @echo "$(call format,xdebug,'Disable or enable Xdebug. Accepts argument `disable`, `enable`, or `status`.')"
  81. analyse:
  82. @./bin/analyse $(call args)
  83. bash:
  84. @./usr/bin/env bash
  85. cache-clean:
  86. @./bin/cache-clean $(call args)
  87. check-dependencies:
  88. @./bin/check-dependencies
  89. cli:
  90. @./bin/cli $(call args)
  91. clinotty:
  92. @./bin/clinotty $(call args)
  93. cliq:
  94. @./bin/cliq $(call args)
  95. composer:
  96. @./bin/composer $(call args)
  97. configure-linux:
  98. @./bin/configure-linux
  99. copyfromcontainer:
  100. @./bin/copyfromcontainer $(call args)
  101. copytocontainer:
  102. @./bin/copytocontainer $(call args)
  103. cron:
  104. @./bin/cron $(call args)
  105. debug-cli:
  106. @./bin/debug-cli $(call args)
  107. deploy:
  108. @./bin/deploy $(call args)
  109. dev-test-run:
  110. @./bin/dev-test-run
  111. dev-urn-catalog-generate:
  112. @./bin/dev-urn-catalog-generate
  113. devconsole:
  114. @./bin/devconsole
  115. docker-compose:
  116. @./bin/docker-compose
  117. docker-stats:
  118. @./bin/docker-stats
  119. download:
  120. @./bin/download $(call args)
  121. fixowns:
  122. @./bin/fixowns $(call args)
  123. fixperms:
  124. @./bin/fixperms $(call args)
  125. grunt:
  126. @./bin/grunt $(call args)
  127. install-php-extensions:
  128. @./bin/install-php-extensions $(call args)
  129. log:
  130. @./bin/log $(call args)
  131. magento:
  132. @./bin/magento $(call args)
  133. magento-version:
  134. @./bin/magento-version
  135. mftf:
  136. @./bin/mftf $(call args)
  137. mysql:
  138. @./bin/mysql $(call args)
  139. mysqldump:
  140. @./bin/mysqldump $(call args)
  141. n98-magerun2:
  142. @./bin/n98-magerun2 $(call args)
  143. node:
  144. @./bin/node $(call args)
  145. npm:
  146. @./bin/npm $(call args)
  147. phpcbf:
  148. @./bin/phpcbf $(call args)
  149. phpcs:
  150. @./bin/phpcs $(call args)
  151. phpcs-json-report:
  152. @./bin/phpcs-json-report $(call args)
  153. pwa-studio:
  154. @./bin/pwa-studio
  155. redis:
  156. @./bin/redis $(call args)
  157. remove:
  158. @./bin/remove
  159. removeall:
  160. @./bin/removeall
  161. removenetwork:
  162. @./bin/removenetwork
  163. removevolumes:
  164. @./bin/removevolumes
  165. restart:
  166. @./bin/restart $(call args)
  167. root:
  168. @./bin/root $(call args)
  169. rootnotty:
  170. @./bin/rootnotty $(call args)
  171. setup:
  172. @./bin/setup $(call args)
  173. setup-composer-auth:
  174. @./bin/setup-composer-auth
  175. setup-domain:
  176. @./bin/setup-domain $(call args)
  177. setup-grunt:
  178. @./bin/setup-grunt
  179. setup-install:
  180. @./bin/setup-install $(call args)
  181. setup-integration-tests:
  182. @./bin/setup-integration-tests
  183. setup-pwa-studio:
  184. @./bin/setup-pwa-studio $(call args)
  185. setup-pwa-studio-sampledata:
  186. @./bin/setup-pwa-studio-sampledata $(call args)
  187. setup-ssl:
  188. @./bin/setup-ssl $(call args)
  189. setup-ssl-ca:
  190. @./bin/setup-ssl-ca
  191. spx:
  192. @./bin/spx $(call args)
  193. start:
  194. @./bin/start $(call args)
  195. status:
  196. @./bin/status
  197. stop:
  198. @./bin/stop $(call args)
  199. stopall:
  200. @./bin/stopall $(call args)
  201. update:
  202. @./bin/update
  203. xdebug:
  204. @./bin/xdebug $(call args)