-
Notifications
You must be signed in to change notification settings - Fork 4
/
ubuntu18.04_configure_dev_env.sh
199 lines (176 loc) · 3.62 KB
/
ubuntu18.04_configure_dev_env.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/bin/bash
# Update packages list
sudo apt update
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo apt install software-properties-common curl -y
if [ ! $? = 0 ]; then
exit 1
fi
curl --version
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo apt install git -y
if [ ! $? = 0 ]; then
exit 1
fi
git --version
if [ ! $? = 0 ]; then
exit 1
fi
# Download executable in local user folder
curl -sS https://get.symfony.com/cli/installer | bash
if [ ! $? = 0 ]; then
exit 1
fi
# Move the executable in global bin directory in order to use it globally
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
if [ ! $? = 0 ]; then
exit 1
fi
symfony -V
if [ ! $? = 0 ]; then
exit 1
fi
# Add PHP official repository
sudo add-apt-repository ppa:ondrej/php -y
if [ ! $? = 0 ]; then
exit 1
fi
# Update packages list
sudo apt update
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo apt install php7.3 -y
if [ ! $? = 0 ]; then
exit 1
fi
# Install extensions
sudo apt install php7.3-mbstring php7.3-mysql php7.3-xml php7.3-curl php7.3-zip php7.3-intl php7.3-gd php-xdebug -y
if [ ! $? = 0 ]; then
exit 1
fi
# Update some configuration in php.ini
phpinipath=$(php -r "echo php_ini_loaded_file();")
if [ ! $? = 0 ]; then
exit 1
fi
sudo bash -c "sed -e 's/post_max_size = 8M/post_max_size = 64M/g' ${phpinipath} > ./php.ini.tmp"
if [ ! $? = 0 ]; then
exit 1
fi
sudo mv ./php.ini.tmp ${phpinipath}
if [ ! $? = 0 ]; then
exit 1
fi
sudo bash -c "sed -e 's/upload_max_filesize = 8M/upload_max_filesize = 64M/g' ${phpinipath} > ./php.ini.tmp"
if [ ! $? = 0 ]; then
exit 1
fi
sudo mv ./php.ini.tmp ${phpinipath}
if [ ! $? = 0 ]; then
exit 1
fi
sudo bash -c "sed -e 's/memory_limit = 128M/memory_limit = -1/g' ${phpinipath} > ./php.ini.tmp"
if [ ! $? = 0 ]; then
exit 1
fi
sudo mv ./php.ini.tmp ${phpinipath}
if [ ! $? = 0 ]; then
exit 1
fi
# Replace default PHP installation in $PATH
sudo update-alternatives --set php /usr/bin/php7.3
if [ ! $? = 0 ]; then
exit 1
fi
php -v
if [ ! $? = 0 ]; then
exit 1
fi
# Download installer
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo php composer-setup.php --version=1.9.1 --install-dir=/usr/local/bin/
if [ ! $? = 0 ]; then
exit 1
fi
# Remove installer
sudo php -r "unlink('composer-setup.php');"
if [ ! $? = 0 ]; then
exit 1
fi
# Make it executable globally
sudo mv /usr/local/bin/composer.phar /usr/local/bin/composer
if [ ! $? = 0 ]; then
exit 1
fi
composer -V
if [ ! $? = 0 ]; then
exit 1
fi
# Add MariaDB official repository
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo -E bash
if [ ! $? = 0 ]; then
exit 1
fi
# Update packages list
sudo apt update
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo apt install mariadb-server-10.4 -y
if [ ! $? = 0 ]; then
exit 1
fi
# Add NodeJS official repository and update packages list
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo apt install nodejs -y
if [ ! $? = 0 ]; then
exit 1
fi
node -v
if [ ! $? = 0 ]; then
exit 1
fi
npm -v
if [ ! $? = 0 ]; then
exit 1
fi
# Add Yarn official repository
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
if [ ! $? = 0 ]; then
exit 1
fi
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
if [ ! $? = 0 ]; then
exit 1
fi
# Update packages list
sudo apt update
if [ ! $? = 0 ]; then
exit 1
fi
# Install
sudo apt install yarn=1.21* -y
if [ ! $? = 0 ]; then
exit 1
fi
yarn -v
if [ ! $? = 0 ]; then
exit 1
fi