-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.sh
47 lines (34 loc) · 1.89 KB
/
setup.sh
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
#!/bin/bash
echo 'Composer Authentication will be required...'
echo 'Credentials are located in the AddressFinder vault of 1Password, search for "Magento Auth"'
echo "Which Magento 2 version? 2.0/[2.1]:"
read mageversion
if [ -z $mageversion ]; then
mageversion='2.1'
fi
echo "Which PHP version? 5.6/[7.0]:"
read phpversion
if [ -z $phpversion ]; then
phpversion='7.0'
fi
phpversion=$(echo $phpversion | sed -e 's/\.//g')
mageversion=$(echo $mageversion | sed -e 's/\.//g')
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml run --rm setup
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml up -d app
# if ! [ -d "./html" ]; then
# containerid=$(docker ps | grep addressfindermagento_app | awk '{print $1}')
# echo 'Copying Magento files to your local machine (for reference only)'
# docker cp $containerid:/var/www/html ./
# fi
echo 'Disabling cache for development purposes'
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml exec phpfpm ./bin/magento cache:disable
echo 'Setting Magento mode to Developer'
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml exec phpfpm ./bin/magento deploy:mode:set developer
if ! [ -L "./html/code/AddressFinder" ]; then
echo 'Installing the AddressFinder module'
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml exec phpfpm ./bin/magento module:enable AddressFinder_AddressFinder
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml exec phpfpm ./bin/magento setup:upgrade
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml exec phpfpm ./bin/magento setup:di:compile
fi
docker-compose -f docker-compose.yml -f docker-compose.mage$mageversion-php$phpversion.yml down
echo 'Setup finished.'