Files
Phraseanet/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
Nicolas Le Goff 1561a5cc92 Improve vm build
2014-09-08 16:39:52 +02:00

108 lines
3.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# timezone
sudo sh -c 'echo "Europe/Paris" > /etc/timezone'
sudo dpkg-reconfigure -f noninteractive tzdata
# locales
sudo sh -c "echo 'LANGUAGE=fr_FR.UTF-8' >> /etc/environment"
sudo sh -c "echo 'LANG=fr_FR.UTF-8' >> /etc/environment"
sudo sh -c "echo 'LC_ALL=fr_FR.UTF-8' >> /etc/environment"
sudo sh -c 'echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "es_ES.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "nl_NL.UTF-8 UTF-8" >> /etc/locale.gen'
sudo locale-gen en_US en_US.UTF-8 en_GB en_GB.UTF-8 fr_FR fr_FR.UTF-8 de_DE de_DE.UTF-8 nl_NL nl_NL.UTF-8
sudo dpkg-reconfigure -f noninteractive locales
# node + npm
cd /tmp
wget quiet "http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz"
tar -zxvf node-v0.10.29-linux-x64.tar.gz
cd node-v0.10.29-linux-x64
find . -maxdepth 1 -type f -exec rm {} \;
sudo cp -rf * /usr/local/
# npm binaries
sudo npm install -g recess
sudo npm install -g grunt-cli
sudo npm install -g bower
#twig
cd /tmp
git clone https://github.com/fabpot/Twig.git
cd Twig/ext/twig
phpize
./configure
make
sudo make install
sudo sh -c 'echo "extension=twig.so" > /etc/php5/cli/conf.d/twig.ini'
sudo sh -c 'echo "extension=twig.so" > /etc/php5/fpm/conf.d/twig.ini'
# phraseanet-extension
cd /tmp
git clone git://github.com/alchemy-fr/Phraseanet-Extension.git
cd Phraseanet-Extension
phpize
./configure
make
sudo make install
if [ $? -eq 0 ]; then
sudo sh -c 'echo "extension=phrasea2.so" > /etc/php5/cli/conf.d/phrasea.ini'
sudo sh -c 'echo "extension=phrasea2.so" > /etc/php5/fpm/conf.d/phrasea.ini'
fi
# phraseanet-indexer
cd /tmp
git clone git://github.com/alchemy-fr/Phraseanet-Indexer.git
cd Phraseanet-Indexer
autoreconf --force --install
./configure
make
sudo make install
# swftools
cd /tmp
wget quiet http://www.swftools.org/swftools-0.9.2.tar.gz
tar -xzvf swftools-0.9.2.tar.gz
cd swftools-0.9.2
./configure
make
sudo make install
# cache file sd
sudo sh -c 'echo "RUN=yes" > /etc/default/cachefilesd'
# copy www.conf
sudo sh -c "cat /vagrant/vagrant/config/nginx/php5-fpm-www.conf > /etc/php5/fpm/pool.d/www.conf"
if [ ! -f /var/www/phraseanet/config/configuration.yml ]
then
#copy configuration template
mv /var/www/phraseanet/lib/conf.d/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml.bkp
cp /vagrant/vagrant/config/phraseanet/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml
mv /var/www/phraseanet/.bowerrc /var/www/phraseanet/.bowerrc.bkp
cp /vagrant/resources/vagrant/config/bower/.bower.rc /var/www/phraseanet/.bowerrc
cd /var/www/phraseanet
composer install -n --prefer-source --dev
bower install --config.interactive=false
bin/developer assets:compile-less
rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
rm -f /var/www/phraseanet/.bowerrc
mv /www/phraseanet/.bowerrc.bkp /www/phraseanet/.bowerrc
mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml
fi
# restart mysql to get new date system
sudo service mysql restart
sudo service php5-fpm restart
sudo service nginx restart
# stoping iptable
sudo service iptables-persistent stop
# reload bash
source ~/.bashrc