#!/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