Created
October 5, 2016 08:37
-
-
Save emgiezet/f40a381121d6d2b02ccea75cf08301ee to your computer and use it in GitHub Desktop.
Oro install and recreate db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
application=$1 | |
env=$2 | |
if [ -z "$application" ]; then echo "application must be passed as an argument"; exit; fi | |
if [ -z "$env" ]; then | |
echo "env set to dev"; | |
env='dev'; | |
fi | |
echo "$env"; | |
# disable xdebug to performance gain | |
sudo phpdismod xdebug | |
cd application/$1 | |
echo "clearing cache" | |
rm -rf app/cache/dev | |
rm -rf app/cache/prod | |
rm -rf app/cache/test | |
echo "composering" | |
COMPOSER=dev.json composer install | |
if [ "$env" = "dev" ]; then | |
echo "db-recreation dev" | |
dropdb -U postgres -h localhost b2b_dev | |
createdb -U postgres -h localhost b2b_dev | |
app/console oro:install --timeout=2000 --drop-database --force --user-name admin --user-password admin --user-firstname=John --user-lastname=Doe --sample-data y --application-url http://b2b.oro --organization-name=ORO [email protected] | |
fi | |
if [ "$env" = "test" ]; then | |
echo "db-recreation test" | |
dropdb -U postgres -h localhost b2b_dev_test | |
createdb -U postgres -h localhost b2b_dev_test | |
app/console oro:install --timeout=2000 --drop-database --force --user-name admin --user-password admin --user-firstname=John --user-lastname=Doe --sample-data n --env=test --application-url http://localhost --organization-name=ORO [email protected] | |
fi | |
# disable xdebug to performance gain | |
sudo phpdismod xdebug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment