-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
96 lines (75 loc) · 2.26 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
94
95
96
VERSION ?= 1.9
default: restart
rebuild: show_rebuild_warning stop build-$(VERSION) start wait_15 install-$(VERSION) start
build-2.1:
export MAGENTO_VERSION=2.1
export MAGENTO_VERSION_SHORT=2
# create directories
sudo rm -rf www/ && mkdir www/
sudo rm -rf mysql/data/ && mkdir -p mysql/data
sudo rm -rf sphinxsearch/data/ && mkdir -p sphinxsearch/data
# extract
cd ./www/; \
find ../install/ -name "Magento-CE-*.tar.gz" -name "*$(VERSION)*" | head -n 1 | xargs tar zxf
cd ./www/; \
chmod -R 777 var/ app/etc pub/media pub/static; \
find bin/ -type f | xargs chmod +x
# container configuration
cp nginx/config/2.1/nginx-web.conf nginx/config/nginx-web.conf
# build images
docker-compose build
install-2.1:
make composer
docker-compose run php_cli sh /srv/assets/magento2-install
build-1.9:
export MAGENTO_VERSION=1.9
export MAGENTO_VERSION_SHORT=1
# create directories
sudo rm -rf www/ && mkdir www/
sudo rm -rf mysql/data/ && mkdir mysql/data
sudo rm -rf sphinxsearch/data/ && mkdir sphinxsearch/data
# extract
cd ./www/; \
find ../install/ -name "*.tar.gz" -name "*$(VERSION)*" | head -n 1 | xargs tar zxf
cd ./www/; \
chmod -R 777 var/ app/etc
# container configuration
cp nginx/config/1.9/nginx-web.conf nginx/config/nginx-web.conf
# build images
docker-compose build
install-1.9:
docker exec -u root php bash -c "echo '$$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx) magento.local' >> /etc/hosts"
docker exec -u www-data php sh /srv/assets/magento1-install
docker exec -u root nginx chown -R www-data:www-data /srv/www
docker exec -u root php n98-magerun sys:info
composer:
docker exec php composer install -v
start:
docker-compose up -d --remove-orphans
stop:
docker-compose stop
restart: stop start
wait_15:
sleep 15
php_cli:
docker exec -ti php bash
php_logs:
docker logs -f php
varnish_cli:
docker exec -ti varnish bash
nginx_cli:
docker exec -ti nginx bash
nginx_logs:
docker logs -f nginx
mysql_cmd:
docker exec -ti mysql mysql -uroot -proot magento
sphinx_cli:
docker exec -ti sphinx bash
sphinx_cmd:
docker exec -ti mysql mysql -hsphinx -P9306 -uroot -proot
sphinx_logs:
docker logs -f sphinx
show_rebuild_warning:
echo "Rebuilding in 5 seconds"
echo "This will destroy ALL your data"
sleep 5