forked from emartech/magento2-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (65 loc) · 3.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
include dev/.env
include tasks/tests.mk
COMPOSE_FILE=dev/docker-compose.yaml
COMPOSE=docker-compose -f $(COMPOSE_FILE) -p mage
default: help
up: ## Creates containers and starts app
cd ./dev/test && npm i
@$(COMPOSE) up -d --build
dup: ## Creates containers and starts app
cd ./dev/test && npm i
@$(COMPOSE) up --build
down: ## Destorys containers
@$(COMPOSE) down
start: ## Starts existing containers
@$(COMPOSE) start
stop: ## Stops containers
@$(COMPOSE) stop
ps: ## Displays container statuses
@$(COMPOSE) ps
ssh: ## Enters the web container
@$(COMPOSE) exec --user application magento-dev bash
ssh-root: ## Enters the web container
@$(COMPOSE) exec magento-dev bash
ssh-test: ## Enters the web container
@$(COMPOSE) exec magento-test bash
ssh-node: ## Enters the web container
@$(COMPOSE) run --rm node /bin/sh
exec: ## Runs command in web container (make exec command=your-command)
@$(COMPOSE) exec magento-dev $(command)
magento: ## Runs Magento CLI command (make magento command=your-command)
@$(COMPOSE) exec --user application magento-dev bin/magento $(command)
clear-db: ## Clears magento db
docker volume rm mage_magento-db
upgrade: ## Runs Magento CLI setup:upgrade command
@$(COMPOSE) exec --user application magento-dev bin/magento cache:flush
@$(COMPOSE) exec --user application magento-dev bin/magento setup:upgrade
compile: ## Runs Magento CLI setup:di:compile command
@$(COMPOSE) exec --user application magento-dev bin/magento cache:flush
@$(COMPOSE) exec --user application magento-dev bin/magento setup:di:compile
flush: ## Runs Magento CLI cache:flush command
@$(COMPOSE) exec --user application magento-dev rm -rf generated/code/
@$(COMPOSE) exec --user application magento-dev bin/magento cache:flush
flush-test: ## Runs Magento CLI cache:flush command
@$(COMPOSE) exec --user application magento-test rm -rf generated/code/
@$(COMPOSE) exec --user application magento-test bin/magento cache:flush
uninstall: ## Uninstalls the extension from the Magento instance
@$(COMPOSE) exec db bash -c 'mysql -u root -p${MYSQL_ROOT_PASSWORD} < /opt/uninstall-extension.sql'
@$(COMPOSE) exec --user application magento-dev rm -rf generated/code/Magento/
@$(COMPOSE) exec --user application magento-dev bin/magento cache:flush
mysql: ## Enter MYSQL command line
@$(COMPOSE) exec db mysql -u magento -p${MYSQL_PASSWORD}
exception: ## Tail Magento exception logs
@echo "Following var/log/exception.log\n"
@$(COMPOSE) exec magento-dev tail -f -n 10 var/log/exception.log
log: ## Tail Magento exception logs
@echo "Following var/log/system.log\n"
@$(COMPOSE) exec magento-dev tail -f -n 10 var/log/system.log
devlog: ## Tail dev conatiner docker logs
@$(COMPOSE) logs -f magento-dev
testlog: ## Tail test conatiner docker logs
@$(COMPOSE) logs -f magento-test
build-cypress: ## Build Cypress image (usage: make build-cypress VERSION=3.1.4)
cd dev/CypressBuild && sh build.sh $(VERSION)
help: ## This help message
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' -e 's/:.*#/: #/' | column -t -s '##'