-
Notifications
You must be signed in to change notification settings - Fork 6
/
installDevEnvironment.sh
executable file
·138 lines (122 loc) · 3.86 KB
/
installDevEnvironment.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
#!/bin/bash
# params: question, function to execute
install_question(){
read -p `echo "$1"` yn
case $yn in
[Yy]* ) eval "$2";
esac
}
install_nginx(){
# Nginx and related
sudo apt-get install nginx php5-fpm
}
install_apache(){
# Apache and related
sudo apt-get install apache2
sudo a2enmod rewrite
sudo apt-get install libapache2-mod-php5
}
install_iconizr(){
basedir=`pwd`
# PNG Tools for Iconizr
sudo apt-get install pngcrush pngquant optipng
sudo apt-get install checkinstall
cd /tmp
wget http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.4/optipng-0.7.4.tar.gz
tar xvf optipng-0.7.4.tar.gz
cd optipng-0.7.4
./configure
make
sudo checkinstall
cd $basedir
}
install_frontend_tools(){
# Frontend tools
# nodejs
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
#grunt
sudo npm install -g grunt-cli
#bower
sudo npm install -g bower
#iconizr
install_iconizr
}
install_java8(){
#java8 for phpstorm
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
}
install_git(){
# git + related
sudo apt-get install git
git config --global color.branch auto
git config --global color.diff auto
git config --global color.status auto
sudo apt-get install gitg
}
install_database(){
# Database (mysql|mysql-workbench|redis|sqlite3)
sudo apt-get install mysql-server
sudo apt-get install php5-mysql
sudo apt-get install sqlite3 php5-sqlite
sudo apt-get install redis-server
if [[ -z `which mysql-workbench` ]]; then
sudo apt-get install mysql-workbench
fi
}
install_php(){
# php
sudo apt-get install php5-cli php5-common php-apc php-pear php5-xdebug php5-curl php5 php5-dev
sudo apt-get install memcached
sudo apt-get install php5-memcache
sudo apt-get install graphicsmagick libgraphicsmagick1-dev
sudo pecl install gmagick-beta
sudo apt-get install php5-xsl
sudo apt-get install php5-intl php5-mcrypt
}
install_phpunit(){
#install newest version of phpunit
sudo apt-get remove phpunit
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit
sudo pear install --force --alldeps phpunit/PHPUnit
}
install_php_qa_tools(){
#php-cs-fixer
sudo wget http://cs.sensiolabs.org/get/php-cs-fixer.phar -O /usr/local/bin/php-cs-fixer
sudo chmod a+x /usr/local/bin/php-cs-fixer
#PHP Code Sniffer
sudo pear channel-update PEAR
sudo pear upgrade PEAR
sudo pear channel-discover pear.phing.info
sudo pear install phing/phing
sudo pear install PHP_CodeSniffer
#phpunit Skeleton Generator
sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit_SkeletonGenerator
}
install_tools(){
sudo apt-get install vim
sudo apt-get install mc
sudo apt-get install g++
sudo apt-get install filezilla
sudo apt-get install curl
}
install_question "Install-frontend-tools->(y|n)" "install_frontend_tools"
install_question "Install-php->(y|n)" "install_php"
install_question "Install-phpunit->(y|n)" "install_phpunit"
install_question "Install-php-qa-tools->(y|n)" "install_php_qa_tools"
install_question "Install-java8-for-PHPStorm->(y|n)" "install_java8"
install_question "Install-tools-like-vim-curl-and-so-on>(y|n)" "install_tools"
install_question "Install-git->(y|n)" "install_git"
install_question "Install-apache->(y|n)" "install_apache"
install_question "Install-nginx->(y|n)" "install_nginx"
install_question "Install-mysql-sqlite-redis->(y|n)" "install_database"