-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathreinstall
executable file
·59 lines (52 loc) · 1.87 KB
/
reinstall
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
#!/bin/bash
shopt -s extglob
cp /var/www/magento-docker/etc/php/tools/* /usr/local/sbin
#clean project dir
if [[ -d .git ]]; then
git clean -dfx -e '.idea' $(mount | grep -oP '/var/www/magento2ce/\K\S*' | xargs -rn 1 echo '-e ')
git checkout composer.lock composer.json
fi
# remove links
find . -type l -delete
#apply edition
dst="/var/www/magento2ce"
for edition in "$@"; do
if ! [[ -d ../${edition} ]]; then
edition=magento2${edition}
fi
if [[ ${edition} == "data-solutions-services-id" ]]; then
dst="/var/www/magento2ce/app/code/Magento"
fi
if [[ -d ../${edition} ]]; then
php /var/www/${edition}/dev/tools/build-ee.php -- --command unlink --exclude true --ce-source ${dst} --ee-source /var/www/${edition}
php /var/www/${edition}/dev/tools/build-ee.php -- --command link --exclude true --ce-source ${dst} --ee-source /var/www/${edition}
if [[ ${edition} == "magento2ee" ]] || [[ ${edition} == "magento2b2b" ]]; then
cp -rlf /var/www/${edition}/composer* ${dst} 2>/dev/null
cp -rlf /var/www/${edition}/setup /var/www/magento2ce/setup 2>/dev/null
fi
if [[ ${edition} == *"storefront"* ]]; then
set +ex;
cp -rf /var/www/${edition}/dev ${dst} 2>/dev/null
set -ex;
fi
fi
done
composer global require hirak/prestissimo
#install magento
composer install
echo y | bin/magento setup:uninstall
bin/magento setup:install \
--cleanup-database \
--backend-frontname=admin \
--admin-lastname=Admin \
--admin-firstname=Admin \
--admin-user=admin \
--admin-password=123123q \
--db-name=magento \
--db-host=db \
--elasticsearch-host=elastic \
--db-prefix=m2_
#do x-setup lines
IFS=$'\n' setup=($(yq read /var/www/magento-docker/docker-compose.yml services.*.x-setup | grep -oP '^(?:\s*\-\s)+(?!null)\K.*'))
for i in ${setup[*]}; do eval "${i}"; done