Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Nov 29, 2020
1 parent e1ab1d2 commit 1849085
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bin/create-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

set -e

source $(dirname ${BASH_SOURCE[0]})/set-env-vars.sh
source $(dirname -- ${BASH_SOURCE[0]})/set-env-vars.sh

ROOT_DB_PWD=
DB_HOST_FLAG=
Expand Down
4 changes: 0 additions & 4 deletions bin/dbconsole.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

set -e

#source $(dirname ${BASH_SOURCE[0]})/set-env-vars.sh

#ROOT_DB_USER=root
#ROOT_DB_PWD=
DB_HOST_FLAG=

if [ -z "${DB_HOST}" ]; then
Expand Down
8 changes: 4 additions & 4 deletions bin/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

source $(dirname ${BASH_SOURCE[0]})/set-env-vars.sh
source $(dirname -- ${BASH_SOURCE[0]})/set-env-vars.sh

PHPOPTS=
COVERAGE=
Expand Down Expand Up @@ -30,11 +30,11 @@ shift $((OPTIND-1))

if [ "${RESET}" = true ]; then
echo "Resetting the database..."
$(dirname ${BASH_SOURCE[0]})/create-db.sh
$(dirname -- ${BASH_SOURCE[0]})/create-db.sh
echo "Purging eZ caches..."
# Some manipulations make the SF console fail to run - that's why we prefer to clear the cache via file purge
#$(dirname ${BASH_SOURCE[0]})/sfconsole.sh ${VERBOSITY} cache:clear
$(dirname ${BASH_SOURCE[0]})/cleanup.sh ez-cache
#$(dirname -- ${BASH_SOURCE[0]})/sfconsole.sh ${VERBOSITY} cache:clear
$(dirname -- ${BASH_SOURCE[0]})/cleanup.sh ez-cache
echo "Running the tests..."
fi

Expand Down
13 changes: 0 additions & 13 deletions bin/set-env-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Set up env vars (if not already set):
# - KERNEL_CLASS, KERNEL_DIR (used by phpunit)
# - CONSOLE_CMD (used by shell scripts)
#
# Uses env vars: EZ_VERSION, `composer` command if EZ_VERSION not set
#
Expand Down Expand Up @@ -42,39 +41,27 @@ if [ "${EZ_VERSION}" = "ezplatform3" ]; then
if [ -z "${KERNEL_DIR}" ]; then
export KERNEL_DIR=vendor/ezsystems/ezplatform/app
fi
if [ -z "${CONSOLE_CMD}" ]; then
export CONSOLE_CMD=vendor/ezsystems/ezplatform/bin/console
fi
elif [ "${EZ_VERSION}" = "ezplatform2" ]; then
if [ -z "${KERNEL_CLASS}" ]; then
export KERNEL_CLASS=AppKernel
fi
if [ -z "${KERNEL_DIR}" ]; then
export KERNEL_DIR=vendor/ezsystems/ezplatform/app
fi
if [ -z "${CONSOLE_CMD}" ]; then
export CONSOLE_CMD=vendor/ezsystems/ezplatform/bin/console
fi
elif [ "${EZ_VERSION}" = "ezplatform" ]; then
if [ -z "${KERNEL_CLASS}" ]; then
export KERNEL_CLASS=AppKernel
fi
if [ -z "${KERNEL_DIR}" ]; then
export KERNEL_DIR=vendor/ezsystems/ezplatform/app
fi
if [ -z "${CONSOLE_CMD}" ]; then
export CONSOLE_CMD=vendor/ezsystems/ezplatform/app/console
fi
elif [ "${EZ_VERSION}" = "ezpublish-community" ]; then
if [ -z "${KERNEL_CLASS}" ]; then
export KERNEL_CLASS=EzPublishKernel
fi
if [ -z "${KERNEL_DIR}" ]; then
export KERNEL_DIR=vendor/ezsystems/ezpublish-community/ezpublish
fi
if [ -z "${CONSOLE_CMD}" ]; then
export CONSOLE_CMD=vendor/ezsystems/ezpublish-community/ezpublish/console
fi
else
printf "\n\e[31mERROR: unsupported eZ version: ${EZ_VERSION}\e[0m\n\n" >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -e

BIN_DIR=$(dirname -- ${BASH_SOURCE[0]})

#cd $(dirname ${BASH_SOURCE[0]})/../..
#cd $(dirname -- ${BASH_SOURCE[0]})/../..

# For php 5.6, Composer needs humongous amounts of ram - which we don't have on Travis. Enable swap as workaround
if [ "${TRAVIS_PHP_VERSION}" = "5.6" ]; then
Expand Down
2 changes: 1 addition & 1 deletion bin/setup/ez-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ STACK_DIR=$(dirname -- $(dirname -- $(dirname -- ${BASH_SOURCE[0]})))

echo "Setting up eZ configuration..."

source $(dirname $(dirname ${BASH_SOURCE[0]}))/set-env-vars.sh
source $(dirname $(dirname -- ${BASH_SOURCE[0]}))/set-env-vars.sh

if [ "${EZ_VERSION}" = "ezplatform3" ]; then
APP_DIR=vendor/ezsystems/ezplatform
Expand Down
17 changes: 15 additions & 2 deletions bin/sfconsole.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
#!/usr/bin/env bash

source $(dirname ${BASH_SOURCE[0]})/set-env-vars.sh
source $(dirname -- ${BASH_SOURCE[0]})/set-env-vars.sh

# @todo should we move the definition of CONSOLE_CMD here ?
if [ -z "${CONSOLE_CMD}" ]; then
if [ "${EZ_VERSION}" = "ezplatform3" ]; then
CONSOLE_CMD=vendor/ezsystems/ezplatform/bin/console
elif [ "${EZ_VERSION}" = "ezplatform2" ]; then
CONSOLE_CMD=vendor/ezsystems/ezplatform/bin/console
elif [ "${EZ_VERSION}" = "ezplatform" ]; then
CONSOLE_CMD=vendor/ezsystems/ezplatform/app/console
elif [ "${EZ_VERSION}" = "ezpublish-community" ]; then
CONSOLE_CMD=vendor/ezsystems/ezpublish-community/ezpublish/console
else
printf "\n\e[31mERROR: unsupported eZ version: ${EZ_VERSION}\e[0m\n\n" >&2
exit 1
fi
fi

php $CONSOLE_CMD "$@"

0 comments on commit 1849085

Please sign in to comment.