Skip to content

Instantly share code, notes, and snippets.

@julienbourdeau
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save julienbourdeau/205df55bcf8aa290bd9e to your computer and use it in GitHub Desktop.

Select an option

Save julienbourdeau/205df55bcf8aa290bd9e to your computer and use it in GitHub Desktop.
PrestaShop - Automatically setup dev environment (clone and install)
#!/bin/bash
red='\e[0;31m'
green='\e[0;32m'
orange='\e[0;33m'
NC='\e[0m' # No Color
remoteGitRepo="git@github.com:PrestaShop/PrestaShop.git"
defaultRootDir="/var/www/"
defaultDir="PrestaShop"
cd defaultRootDir
if [ -d $defaultRootDir$defaultDir ]; then
echo -e "${orange}Deleting existing $defaultRootDir$defaultDir ${NC}"
sudo rm -rf $defaultRootDir$defaultDir
fi
echo -e "${green}Cloning remote git repository ${NC}"
git clone --recursive $remoteGitRepo
cd $defaultDir
echo -e "${green}Installing PrestaShop ${NC}"
php ./install-dev/index_cli.php --domain=prestashop.ps --db_server=localhost --db_name=XXXXXXXXXX --db_user=XXXXXXXXXX --db_password="XXXXXXXXXX"
echo -e "${green}Moving each module to 'dev' branch ${NC}"
git submodule foreach git checkout dev
git submodule foreach git pull --no-rebase
echo -e "${green}Tweaking git repository ${NC}"
git config core.fileMode false
git foreach git config core.fileMode false
echo -e "${green}Installing git hooks ${NC}"
cd .git/hooks
wget https://raw.githubusercontent.com/PrestaShop/standard_coding_hook/master/commit-msg
wget https://raw.githubusercontent.com/PrestaShop/standard_coding_hook/master/pre-commit
@julienbourdeau

Copy link
Copy Markdown
Author

How to use

  1. Replace XXXX by your actual database information
  2. Check if you're happy with the defaultRootDir path
  3. bash mkps.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment