-
Notifications
You must be signed in to change notification settings - Fork 10
/
install
62 lines (49 loc) · 1.74 KB
/
install
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
#!/bin/bash
# Check is magento root dir
[ -x 'bin/magento' ] || { echo >&2 "The script requires installed \"Magento 2\" "; pwd; exit 1; }
# Check availability of composer
hash composer 2>/dev/null || { echo >&2 "The script requires \"composer\" (https://getcomposer.org/download/)"; exit 1; }
composer config repositories.swissup composer https://docs.swissuplabs.com/packages/
composer config repositories.packagist false
packages=$(composer show --available | grep "swissup/module-\|swissup/theme-" | cut -d ' ' -f 1 | tr '\n\012\015' ' ');
composer config --unset repositories.packagist
for PACKAGE in $packages; do
echo "Installing $PACKAGE"
composer require --prefer-source --ignore-platform-reqs $PACKAGE
done
MAGENTO_BIN='php bin/magento';
if [ -x 'vendor/bin/dockerizer' ]
then
vendor/bin/dockerizer restart
MAGENTO_BIN='vendor/bin/dockerizer bin/magento';
fi
# Enable new modules
DISABLED_MODULES=$($MAGENTO_BIN module:status --disabled | grep Swissup_)
MODULES=$($MAGENTO_BIN module:status | grep Swissup_)
$MAGENTO_BIN module:enable $MODULES
$MAGENTO_BIN module:disable $DISABLED_MODULES
# Initialize repository in `vendor/swissup` folder and add each subfolder as git submodule
cd vendor/swissup
if [ ! -d '.git' ]
then
git init
for module in *; do
# echo $module
git submodule add "./$module"
done;
git add .
git commit -m "Initial commit"
fi
# Update all modules
for module in *; do
cd $module
git checkout master
git pull
cd ../
done;
cd ../..
# Run magento upgrade scripts
$MAGENTO_BIN setup:upgrade
rm -rf pub/static/_requirejs var/view_preprocessed pub/static/frontend/ pub/static/adminhtml/ generated/code/
$MAGENTO_BIN setup:static-content:deploy -f
$MAGENTO_BIN setup:di:compile