I'm currently writing a simple bash to install new prestashop project on a centos 6 dedicated server. The main idea behind is to automate the creation of new sites in an easy proccess.
This way, the developer, simply type the project name and sql connection credentials and the script install all the neccesary scripts including host configuration:
#!/bin/sh
read -p "Nombre del proyecto (será el mismo que la carpeta y el nombre de la bbdd): " project
read -p "Dominio (es recomedable un subdominio tipo xxx.desarrollotrevenque.com): " domain
read -p "Usuario de la bbdd: " user
read -p "Contraseña de la bbdd: " pass
read -p "email del proyecto: " email
echo "Iniciando proyecto $project ..."
# creamos la carpeta de nuestro proyecto
mkdir /web_path/$project
cp -Rf web_template/* /web_path/$project
cp web_template/.gitignore /web_path/$project
cd /web_path/$project
sudo chown -Rf code:apache web log
sudo chmod -Rf 775 web log
echo "<VirtualHost *:80>
... $project configuration---
</VirtualHost>" >> vhost/dev.vhost
sudo ln -s /web_path/$project/vhost/dev.vhost "/etc/httpd/sites-available/$project.vhost.conf"
# Instalamos Prestashop
wget https://github.com/PrestaShop/PrestaShop/archive/1.6.zip
unzip 1.6.zip
mv PrestaShop-1.6 /web_path/$project/web
mysql -u$user -p$pass -e " CREATE DATABASE $project"
php /web_path/$project/web/install-dev/index_cli.php --domain=$domain --db_server=localhost --db_name=$project --db_user=$user --db_password=$pass --email=$email --password=password --first-name=test--second-name=test--name=$project --language=es
It works like a charm. But the default prestashop installed doesn't have:
Modules
Any sample data
Ideally, for me, the script must include two options:
Modules option: --modules=module1,module2, or maybe something lik --default-modules=true
Data: --fixtures=/path/
Hope it helps