forked from markshust/docker-magento
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickstart
executable file
·75 lines (64 loc) · 2.37 KB
/
quickstart
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
#!/bin/bash
install_type=""
echo -e "\033[1;6;33mRemember to configure your environment variables before proceeding with this quickstart wizard! \033[0m"
while
read -p "Installation type (blank/git):" install_type
[[ "$install_type" != "blank" && "$install_type" != "git" ]] || break
do true; done
magento_latest="2.4.2"
#Configure magento domain
while
read -p "Domain (default: magento2.test):" magento_domain
if [ -z "$magento_domain" ]; then
magento_domain="magento2.test"
fi
[[ -z "$magento_domain" ]] || break
do true; done
cd compose
# Check if already setup already ran
if [ -d "src" ]; then
echo "Magento source directory already exists."
echo "Proceeding may corrupt the current installation!"
read -p "Are you sure you want to continue? (y/n):" force_install
if [ "$force_install" != "y" ]; then
exit
fi
fi
# Install Magento
if [ "$install_type" == "git" ]; then
git clone [email protected]:GamesmenJordan/magento2.git src
cd src && composer update --ignore-platform-reqs
cd ..
elif [ "$install_type" == "blank" ]; then
# Get Magento version to install
read -p "Magento Version (default: $magento_latest):" magento_version
if [ -z $magento_version ]; then
magento_version=$magento_latest
fi
# Get Magento edition to install
while
read -p "Magento Edition (ce/ee):" ed
if [ "$ed" == "ce" ]; then
magento_edition="community-edition"
elif [ "$ed" == "ee" ]; then
magento_edition="enterprise-edition"
fi
[[ -z "$magento_edition" ]] && echo "Must choose an edition" || break
do true; done
# Download Magento source
composer create-project --repository=https://repo.magento.com/ --ignore-platform-reqs --prefer-dist "magento/project-$magento_edition=$magento_version" src
fi
# Create hosts file entry
if grep -Fxq "$magento_domain$" "/etc/hosts"; then
while
read -p "Magento domain detected in hosts file, do you want to appned a new host record anyway? (y/n):" force_append_domain
[[ "$force_append_domain" != "y" || "$force_append_domain" != "n" ]] || break
do true; done
if [ "$force_append_domain" = "y" ]; then
sudo echo "127.0.0.1 \:\:1 $magento_domain" >> "/etc/hosts"
fi
else
echo "127.0.0.1 \:\:1 $magento_domain" >> "/etc/hosts"
fi
# Run built in setup
bin/setup "$magento_domain"