Skip to content

Instantly share code, notes, and snippets.

@emgiezet
Created October 5, 2016 08:37
Show Gist options
  • Save emgiezet/f40a381121d6d2b02ccea75cf08301ee to your computer and use it in GitHub Desktop.
Save emgiezet/f40a381121d6d2b02ccea75cf08301ee to your computer and use it in GitHub Desktop.
Oro install and recreate db
#!/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 --user-email=admin@example.com
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 --user-email=admin@example.com
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