-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
131 lines (107 loc) · 3.6 KB
/
bootstrap.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
#!/usr/bin/env bash
source /vagrant/Vagentofile
# Update
# --------------------
apt-get update
# Install Apache & PHP
# --------------------
apt-get install -y apache2
apt-get install -y php5
apt-get install -y libapache2-mod-php5
apt-get install -y php5-mysql php5-curl php5-gd php5-intl php-pear php5-imap php5-mcrypt php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php-apc
# Install postfix
# --------------------
debconf-set-selections <<< "postfix postfix/mailname string $DOMAIN"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
apt-get install -y postfix
# Install vim, curl, git, unzip
# --------------------
apt-get install -y vim git curl wget unzip
# Install nodejs (with npm), and then grunt and yeoman
# --------------------
apt-get remove -y nodejs
apt-get install -y python-software-properties
apt-add-repository -y ppa:chris-lea/node.js
apt-get update
apt-get install -y nodejs
npm install -g grunt-cli grunt-init yo
# Composer
# --------------------
curl -sS https://getcomposer.org/installer | php
sudo chmod +x ./composer.phar
mv composer.phar /usr/local/bin/composer
# Magerun
# --------------------
wget https://raw.githubusercontent.com/netz98/n98-magerun/master/n98-magerun.phar
sudo chmod +x ./n98-magerun.phar
sudo cp ./n98-magerun.phar /usr/local/bin/
# Modman
# --------------------
wget https://raw.githubusercontent.com/colinmollenhour/modman/master/modman
sudo chmod +x ./modman
sudo cp ./modman /usr/local/bin/
# Vagento
# --------------------
sudo rm -f vagento.sh /usr/local/bin/vagento
wget https://raw.githubusercontent.com/stuntcoders/vagento/master/vagento.sh
sudo chmod +x ./vagento.sh
sudo mv ./vagento.sh /usr/local/bin/vagento
# WP cli
# --------------------
curl -L https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/bin/wp
# Update Gem and install bourbon
# --------------------
gem update --system
gem install bourbon
# Set default coding style for the project or overwrite the existing one with newest
# --------------------
if [ ! -f "/vagrant/.editorconfig" ]; then
wget https://raw.githubusercontent.com/stuntcoders/vagento/master/.editorconfig -O /vagrant/.editorconfig
fi
# Add robots.txt for staging
# --------------------
if [ ! -f "/vagrant/.robots.txt.staging" ]; then
wget https://raw.githubusercontent.com/stuntcoders/vagento/master/.robots.txt.staging -O /vagrant/.robots.txt.staging
fi
# Add robots.txt for production
# --------------------
if [ ! -f "/vagrant/.robots.txt.production" ]; then
wget https://raw.githubusercontent.com/stuntcoders/vagento/master/.robots.txt.production -O /vagrant/.robots.txt.production
fi
# Delete default apache web dir and symlink mounted vagrant dir from host machine
# --------------------
rm -rf /var/www
if [ ! -d "/vagrant/httpdocs" ]; then
mkdir /vagrant/httpdocs
fi
ln -fs /vagrant /var/www
# Replace contents of default Apache vhost
# --------------------
VHOST=$(cat <<EOF
<VirtualHost *:80>
DocumentRoot "/vagrant"
ServerName localhost
<Directory "/vagrant">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
)
echo "$VHOST" > /etc/apache2/sites-enabled/000-default.conf
sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name'
sudo bash -c "echo '127.0.0.1 $DOMAIN' >> /etc/hosts"
a2enmod rewrite
a2enmod headers
service apache2 restart
apt-get remove -y php5-snmp
# Mysql
# --------------------
# Ignore the post install questions
export DEBIAN_FRONTEND=noninteractive
# Install MySQL quietly
apt-get -q -y install mysql-server-5.5
cd /vagrant/
vagento