Skip to content

Commit

Permalink
Vagrant bootstrapping complete
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Aug 20, 2015
1 parent 51b14da commit c421248
Show file tree
Hide file tree
Showing 5 changed files with 1,516 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.env
.project
.buildpath
.vagrant/
composer.lock
vendor/
MAINT_MODE_ENABLED
Expand Down
4 changes: 3 additions & 1 deletion application/configs/application.ini.vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,11 @@ resources.smarty.debugging = 0
; frontend.disabled.cust-kit = 1
; frontend.disabled.console-server-connection = 1

frontend.disabled.meeting = 1

; Set this up before enabling:
; See: https://github.com/inex/IXP-Manager/wiki/Route-Server-Prefix-Analysis-Tool
frontend.disabled.rs-prefixes = 1
; frontend.disabled.rs-prefixes = 1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
27 changes: 20 additions & 7 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
#!/usr/bin/env bash

apt-get update

# Defaults for MySQL and phpMyAdmin:
debconf-set-selections <<< 'mysql-server mysql-server/root_password password password'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password password'
echo 'phpmyadmin phpmyadmin/dbconfig-install boolean true' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/app-password-confirm password password' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/mysql/admin-pass password password' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/mysql/app-pass password password' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | debconf-set-selections

apt-get install -y apache2 php5 php5-intl php5-mysql php5-rrd php5-cgi php5-cli php5-snmp php5-curl php5-mcrypt \
php5-memcache libapache2-mod-php5 mysql-server mysql-client joe memcached snmp
php5-memcache libapache2-mod-php5 mysql-server mysql-client joe memcached snmp nodejs nodejs-legacy npm \
phpmyadmin

if ! [ -L /var/www ]; then
rm -rf /var/www
ln -fs /vagrant/public /var/www
fi

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
npm install -g bower

mysql -u root -ppassword <<END_SQL
export MYSQL_PWD=password

mysql -u root <<END_SQL
DROP DATABASE IF EXISTS \`ixp\`;
CREATE DATABASE \`ixp\` CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_unicode_ci';
GRANT ALL ON \`ixp\`.* TO \`ixp\`@\`127.0.0.1\` IDENTIFIED BY 'password';
Expand All @@ -21,9 +34,9 @@ FLUSH PRIVILEGES;
END_SQL

if [[ -f /vagrant/ixpmanager-preferred.sql.bz2 ]]; then
bzcat /vagrant/ixpmanager-preferred.sql.bz2 | mysql -u root -ppassword ixp
else if [[ -f /vagrant/database/vagrant-base.sql.bz2 ]]; then
bzcat /vagrant/database/vagrant-base.sql.bz2 | mysql -u root -ppassword ixp
bzcat /vagrant/ixpmanager-preferred.sql.bz2 | mysql -u root ixp
elif [[ -f /vagrant/database/vagrant-base.sql ]]; then
cat /vagrant/database/vagrant-base.sql | mysql -u root ixp
fi

cat >/vagrant/.env <<END_ENV
Expand All @@ -44,8 +57,8 @@ ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cgi/conf.d/20-mcrypt.ini
ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini

cd /vagrant
composer install

su - vagrant -c "cd /vagrant && composer install"
su - vagrant -c "cd /vagrant && bower --config.interactive=false -f update"

cat >/etc/apache2/sites-available/000-default.conf <<END_APACHE
<VirtualHost *:80>
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"tests"
],
"dependencies": {
"bootstrap": "~3.3.0"
"bootstrap": "~3.3.0",
"chosen": "~1.4.2"
},
"resolutions": {
"jquery": ">=2.1.1"
Expand Down
Loading

0 comments on commit c421248

Please sign in to comment.