Skip to content

Instantly share code, notes, and snippets.

@igor822
Created June 18, 2015 11:43
Show Gist options
  • Save igor822/d4023b7e94ffe8761fde to your computer and use it in GitHub Desktop.
Save igor822/d4023b7e94ffe8761fde to your computer and use it in GitHub Desktop.
Symfony environment configurator
#!/bin/sh
path_project="$1"
DISTRO="unknown"
if [[ -z $path_project ]]; then
echo "Please add the path of project"
exit 1
fi
mac_install() {
if ! type "vagrant" > /dev/null; then
echo "\033[31mPlease install Vagrant\033[0m"
exit 1
fi
if ! type "brew" > /dev/null; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if ! type "ruby" > /dev/null; then
brew install ruby
echo "\033[32mPackage: \033[2mRuby\033[22m successful installed\033[0m"
exit 1
fi
if ! type "ansible" > /dev/null; then
brew install ansible
echo "\033[32mPackage: \033[2mAnsible\033[22m successful installed\033[0m"
else
echo "\033[32mPackage: \033[2mAnsible\033[22m already installed\033[0m"
fi
}
if [[ "$OSTYPE" == "linux" ]]; then
echo 'linux'
elif [[ "$OSTYPE" == "darwin"* ]]; then
mac_install
fi
# Composer install
if ! type "composer" > /dev/null; then
echo "\033[32mInstalling composer:\033[0m"
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
echo "\033[32mComposer successful installed\033[0m"
fi
echo "\033[32mCreating symfony project\033[0m"
composer create-project symfony/framework-standard-edition $path_project 2.7.*
cd $path_project
git clone https://github.com/kleiram/vagrant-symfony.git vagrant
cd "$(pwd)/vagrant"
pwd
echo "\033[32mInitializating Vagrant\033[0m"
vagrant up
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment