-
Notifications
You must be signed in to change notification settings - Fork 57
/
install.sh
176 lines (157 loc) · 5.95 KB
/
install.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/env bash
# This script installs the Magento and its server environment. It installs
# Nginx, PHP7, MySQL, Postfix, Composer, Magento 2, Magento sample data and all
# required packages and dependencies. It also set the Linux swapping and Vhost
# configuration.
#
# This script makes ready Magento 2 to work for development and sets a single
# one store for one website.
#
# This Magento environment fine for module and template development and Magento
# core contribution development.
#
# Pre-requirements: Ubuntu 18.04 with Internet connection.
#
# To install Magento, first fill out the install.ini file then run the command
# "sudo bash install.sh"
#
# YOUAMA 2016
# CREATED BY DAVID BELICZA
DOMAIN=$(awk -F "=" '/domain/ {print $2}' install.ini)
BASE_URL=$(awk -F "=" '/base_url/ {print $2}' install.ini)
MAGENTO_RELEASE=$(awk -F "=" '/magento_release/ {print $2}' install.ini)
DATABASE_HOST=$(awk -F "=" '/database_host/ {print $2}' install.ini)
DATABASE_NAME=$(awk -F "=" '/database_name/ {print $2}' install.ini)
DATABASE_USER=$(awk -F "=" '/database_user/ {print $2}' install.ini)
DATABASE_PASS=$(awk -F "=" '/database_pass/ {print $2}' install.ini)
LINUX_MAGENTO_USER_NAME=$(awk -F "=" '/linux_magento_user_name/ {print $2}' install.ini)
LINUX_MAGENTO_USER_PASS=$(awk -F "=" '/linux_magento_user_pass/ {print $2}' install.ini)
MAGENTO_CONNECT_PUBLIC_KEY=$(awk -F "=" '/magento_connect_public_key/ {print $2}' install.ini)
MAGENTO_CONNECT_PRIVATE_KEY=$(awk -F "=" '/magento_connect_private_key/ {print $2}' install.ini)
LANGUAGE_CODE=$(awk -F "=" '/language_code/ {print $2}' install.ini)
CURRENCY_CODE=$(awk -F "=" '/currency_code/ {print $2}' install.ini)
ADMIN_LOGIN_NAME=$(awk -F "=" '/admin_login_name/ {print $2}' install.ini)
ADMIN_LOGIN_PASS=$(awk -F "=" '/admin_login_pass/ {print $2}' install.ini)
ADMIN_EMAIL=$(awk -F "=" '/admin_email/ {print $2}' install.ini)
INSTALL_BASICS=$(awk -F "=" '/install_basics/ {print $2}' install.ini)
INSTALL_NGINX=$(awk -F "=" '/install_nginx/ {print $2}' install.ini)
INSTALL_APACHE=$(awk -F "=" '/install_apache/ {print $2}' install.ini)
INSTALL_MYSQL=$(awk -F "=" '/install_mysql/ {print $2}' install.ini)
INSTALL_PHP=$(awk -F "=" '/install_php/ {print $2}' install.ini)
INSTALL_MAILER=$(awk -F "=" '/install_mailer/ {print $2}' install.ini)
INSTALL_CERTBOT=$(awk -F "=" '/install_certbot/ {print $2}' install.ini)
INSTALL_COMPOSER=$(awk -F "=" '/install_composer/ {print $2}' install.ini)
INSTALL_REDIS=$(awk -F "=" '/install_redis/ {print $2}' install.ini)
SWAPING_SETTINGS=$(awk -F "=" '/swaping_settings/ {print $2}' install.ini)
MAGENTO_CONNECT_KEY_STORING=$(awk -F "=" '/magento_connect_key_storing/ {print $2}' install.ini)
MAGENTO_WEBSERVER_CONFIG=$(awk -F "=" '/magento_webserver_config/ {print $2}' install.ini)
MAGENTO_DEPENDENCY_INJECTION=$(awk -F "=" '/magento_dependency_injection/ {print $2}' install.ini)
MAGENTO_INSTALLATION=$(awk -F "=" '/magento_installation/ {print $2}' install.ini)
MAGENTO_SAMPLE_DATA_INSTALLATION=$(awk -F "=" '/magento_sample_data_installation/ {print $2}' install.ini)
WAIT=$(awk -F "=" '/wait/ {print $2}' install.ini)
apt-get update
if [ $INSTALL_BASICS == "yes" ];
then
echo ""
echo "INSTALLATION: BASIC LINUX PACKAGES"
sleep $WAIT
bash install/basics.sh
fi;
if [ $INSTALL_NGINX == "yes" ];
then
echo ""
echo "INSTALLATION: NGINX WEB-SERVER"
sleep $WAIT
bash install/nginx.sh
fi;
if [ $INSTALL_APACHE == "yes" ];
then
echo ""
echo "INSTALLATION: APACHE WEB-SERVER"
sleep $WAIT
bash install/apache.sh
fi;
if [ $INSTALL_MYSQL == "yes" ];
then
echo ""
echo "INSTALLATION AND CONFIGURATION: MYSQL DATABASE AND SERVER"
sleep $WAIT
bash install/mysql.sh $DATABASE_NAME $DATABASE_PASS
fi;
if [ $INSTALL_PHP == "yes" ];
then
echo ""
echo "INSTALLATION: FULL PHP 7"
sleep $WAIT
bash install/php7.sh
fi;
if [ $INSTALL_MAILER == "yes" ];
then
echo ""
echo "INSTALLATION AND CONFIGURATION: POSTFIX EMAIL SENDER"
sleep $WAIT
bash install/postfix.sh $DOMAIN
fi;
if [ $INSTALL_CERTBOT == "yes" ];
then
echo ""
echo "INSTALLATION: CERTBOT"
sleep $WAIT
bash install/certbot.sh
fi;
if [ $INSTALL_COMPOSER == "yes" ];
then
echo ""
echo "INSTALLATION: COMPOSER FOR PHP"
sleep $WAIT
bash install/composer.sh
fi;
if [ $INSTALL_REDIS == "yes" ];
then
echo ""
echo "INSTALLATION: REDIS"
sleep $WAIT
bash install/redis.sh
fi;
if [ $SWAPING_SETTINGS == "yes" ];
then
echo ""
echo "SETUP: LINUX SWAP MEMORY FOR UBUNTU 18.04"
sleep $WAIT
bash install/swap.sh
fi;
if [ $MAGENTO_WEBSERVER_CONFIG == "yes" ];
then
echo ""
echo "CONFIGURATION: NGINX FOR MAGENTO 2"
sleep $WAIT
bash install/magento-prepare.sh $MAGENTO_RELEASE $DOMAIN $LINUX_MAGENTO_USER_NAME $LINUX_MAGENTO_USER_PASS
fi;
if [ $MAGENTO_CONNECT_KEY_STORING == "yes" ];
then
echo ""
echo "CONFIGURATION: MAGENTO CONNECT KEYS"
sleep $WAIT
bash install/auth-json.sh $DOMAIN $MAGENTO_CONNECT_PUBLIC_KEY $MAGENTO_CONNECT_PRIVATE_KEY
fi;
if [ $MAGENTO_DEPENDENCY_INJECTION == "yes" ];
then
echo ""
echo "INSTALLATION: MAGENTO 2 COMPOSER PROJECT"
sleep $WAIT
bash install/magento-injection.sh $DOMAIN $MAGENTO_RELEASE
fi;
if [ $MAGENTO_INSTALLATION == "yes" ];
then
echo ""
echo "INSTALLATION: THE MAGENTO 2"
sleep $WAIT
bash install/magento-install.sh $DOMAIN $BASE_URL $DATABASE_HOST $DATABASE_NAME $DATABASE_USER $DATABASE_PASS $ADMIN_EMAIL $ADMIN_LOGIN_NAME $ADMIN_LOGIN_PASS $LANGUAGE_CODE $CURRENCY_CODE
fi;
if [ $MAGENTO_SAMPLE_DATA_INSTALLATION == "yes" ];
then
echo ""
echo "INSTALLATION: MAGENTO 2 SAMPLE DATA DEMO STORE"
sleep $WAIT
bash install/magento-sample.sh $DOMAIN $LANGUAGE_CODE
fi;