Makefile 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. SHELL := /bin/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 "%s %-38s %s" "$(call yellow,$1)" "$(call green,$2)" $3)
  7. comma:= ,
  8. .DEFAULT_GOAL:=help
  9. %:
  10. @:
  11. help:
  12. @echo ""
  13. @echo "$(call green,Use the following CLI commands:)"
  14. @echo "$(call red,===============================)"
  15. @echo "$(call format,make,help,'Print list of commands with comment.')"
  16. @echo "$(call format,make,bash,'Drop into the bash prompt of your Docker container.')"
  17. @echo "$(call format,make,cache-clean,'Access the cache-clean CLI.')"
  18. @echo "$(call format,make,cli,'Run any CLI command without going into the bash prompt.')"
  19. @echo "$(call format,make,clinotty,'Run any CLI command with no TTY.')"
  20. @echo "$(call format,make,cliq,'Run any CLI command but pipes all output to /dev/null.')"
  21. @echo "$(call format,make,composer,'Run the composer binary.')"
  22. @echo "$(call format,make,copyfromcontainer,'Copy folders or files from container to host.')"
  23. @echo "$(call format,make,copytocontainer,'Copy folders or files from host to container.')"
  24. @echo "$(call format,make,cron,'Start or stop the cron service.')"
  25. @echo "$(call format,make,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
  26. @echo "$(call format,make,devconsole,'Alias for n98-magerun2 dev:console.')"
  27. @echo "$(call format,make,devtools-cli-check,'Check & install the CLI devtools if missing from system.')"
  28. @echo "$(call format,make,download,'Download & extract specific Magento version to the src directory.')"
  29. @echo "$(call format,make,fixowns,'This will fix filesystem ownerships within the container.')"
  30. @echo "$(call format,make,fixperms,'This will fix filesystem permissions within the container.')"
  31. @echo "$(call format,make,grunt,'Run the grunt binary.')"
  32. @echo "$(call format,make,magento,'Run the Magento CLI.')"
  33. @echo "$(call format,make,mftf,'Run the Magento MFTF.')"
  34. @echo "$(call format,make,mysql,'Run the MySQL CLI with database config from env/db.env.')"
  35. @echo "$(call format,make,mysqldump,'Backup the Magento database.')"
  36. @echo "$(call format,make,n98-magerun2,'Access the n98-magerun2 CLI.')"
  37. @echo "$(call format,make,node,'Run the node binary.')"
  38. @echo "$(call format,make,npm,'Run the npm binary.')"
  39. @echo "$(call format,make,pwa-studio,'(BETA) Start the PWA Studio server.')"
  40. @echo "$(call format,make,redis,'Run a command from the redis container.')"
  41. @echo "$(call format,make,remove,'Remove all containers.')"
  42. @echo "$(call format,make,removeall,'Remove all containers$(comma) networks$(comma) volumes$(comma) and images.')"
  43. @echo "$(call format,make,removevolumes,'Remove all volumes.')"
  44. @echo "$(call format,make,restart,'Stop and then start all containers.')"
  45. @echo "$(call format,make,root,'Run any CLI command as root without going into the bash prompt.')"
  46. @echo "$(call format,make,rootnotty,'Run any CLI command as root with no TTY.')"
  47. @echo "$(call format,make,setup,'Run the Magento setup process to install Magento from the source code$(comma) with optional domain name.')"
  48. @echo "$(call format,make,setup-composer-auth,'Setup authentication credentials for Composer.')"
  49. @echo "$(call format,make,setup-domain,'Setup Magento domain name.')"
  50. @echo "$(call format,make,setup-grunt,'Install and configure Grunt JavaScript task runner.')"
  51. @echo "$(call format,make,setup-pwa-studio,'(BETA) Install PWA Studio.')"
  52. @echo "$(call format,make,setup-ssl,'Generate an SSL certificate for one or more domains.')"
  53. @echo "$(call format,make,setup-ssl-ca,'Generate a certificate authority and copy it to the host.')"
  54. @echo "$(call format,make,start,'Start all containers.')"
  55. @echo "$(call format,make,status,'Check the container status.')"
  56. @echo "$(call format,make,stop,'Stop all containers.')"
  57. @echo "$(call format,make,update,'Stop all containers.')"
  58. @echo "$(call format,make,xdebug,'Disable or enable Xdebug.')"
  59. bash:
  60. @./bin/bash
  61. cache-clean:
  62. @./bin/cache-clean $(call args)
  63. cli:
  64. @./bin/cli $(call args)
  65. clinotty:
  66. @./bin/clinotty $(call args)
  67. cliq:
  68. @./bin/cliq $(call args)
  69. composer:
  70. @./bin/composer $(call args)
  71. copyfromcontainer:
  72. @./bin/copyfromcontainer $(call args)
  73. copytocontainer:
  74. @./bin/copytocontainer $(call args)
  75. cron:
  76. @./bin/cron $(call args)
  77. dev-urn-catalog-generate:
  78. @./bin/dev-urn-catalog-generate
  79. devconsole:
  80. @./bin/devconsole
  81. devtools-cli-check:
  82. @./bin/devtools-cli-check
  83. download:
  84. @./bin/download $(call args)
  85. fixowns:
  86. @./bin/fixowns $(call args)
  87. fixperms:
  88. @./bin/fixperms $(call args)
  89. grunt:
  90. @./bin/grunt $(call args)
  91. magento:
  92. @./bin/magento $(call args)
  93. mftf:
  94. @./bin/mftf $(call args)
  95. mysql:
  96. @./bin/mysql $(call args)
  97. mysqldump:
  98. @./bin/mysqldump $(call args)
  99. n98-magerun2:
  100. @./bin/n98-magerun2 $(call args)
  101. node:
  102. @./bin/node $(call args)
  103. npm:
  104. @./bin/npm $(call args)
  105. pwa-studio:
  106. @./bin/pwa-studio
  107. redis:
  108. @./bin/redis $(call args)
  109. remove:
  110. @./bin/remove
  111. removeall:
  112. @./bin/removeall
  113. removevolumes:
  114. @./bin/removevolumes
  115. restart:
  116. @./bin/restart $(call args)
  117. root:
  118. @./bin/root $(call args)
  119. rootnotty:
  120. @./bin/rootnotty $(call args)
  121. setup:
  122. @./bin/setup $(call args)
  123. setup-composer-auth:
  124. @./bin/setup-composer-auth
  125. setup-domain:
  126. @./bin/setup-domain $(call args)
  127. setup-grunt:
  128. @./bin/setup-grunt
  129. setup-pwa-studio:
  130. @./bin/setup-pwa-studio $(call args)
  131. setup-ssl:
  132. @./bin/setup-ssl $(call args)
  133. setup-ssl-ca:
  134. @./bin/setup-ssl-ca
  135. start:
  136. @./bin/start $(call args)
  137. status:
  138. @./bin/status
  139. stop:
  140. @./bin/stop $(call args)
  141. update:
  142. @./bin/update
  143. xdebug:
  144. @./bin/xdebug $(call args)