diff --git a/shopware/administration/6.4/bin/build-administration.sh b/shopware/administration/6.4/bin/build-administration.sh index 6f889dd..e18f44f 100755 --- a/shopware/administration/6.4/bin/build-administration.sh +++ b/shopware/administration/6.4/bin/build-administration.sh @@ -2,6 +2,21 @@ CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +export PROJECT_ROOT="${PROJECT_ROOT:-"$(dirname "$CWD")"}" +export ENV_FILE=${ENV_FILE:-"${PROJECT_ROOT}/.env"} + +# shellcheck source=functions.sh +source "${PROJECT_ROOT}/bin/functions.sh" + +curenv=$(declare -p -x) + +load_dotenv "$ENV_FILE" + +# Restore environment variables set globally +set -o allexport +eval "$curenv" +set +o allexport + set -euo pipefail export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true @@ -21,6 +36,7 @@ fi # build admin [[ ${SHOPWARE_SKIP_BUNDLE_DUMP-""} ]] || "${BIN_TOOL}" bundle:dump +"${BIN_TOOL}" feature:dump || true if [[ $(command -v jq) ]]; then OLDPWD=$(pwd) @@ -60,5 +76,4 @@ if [[ -z "${SHOPWARE_SKIP_ENTITY_SCHEMA_DUMP-""}" ]] && [[ -f "${ADMIN_ROOT}"/Re fi (cd "${ADMIN_ROOT}"/Resources/app/administration && npm run build) - [[ ${SHOPWARE_SKIP_ASSET_COPY-""} ]] ||"${BIN_TOOL}" assets:install diff --git a/shopware/administration/6.4/bin/watch-administration.sh b/shopware/administration/6.4/bin/watch-administration.sh index 64d5a93..ea64fc1 100755 --- a/shopware/administration/6.4/bin/watch-administration.sh +++ b/shopware/administration/6.4/bin/watch-administration.sh @@ -22,8 +22,10 @@ export ESLINT_DISABLE export PORT export APP_URL -bin/console bundle:dump -bin/console feature:dump || true +BIN_TOOL="${CWD}/console" + +[[ ${SHOPWARE_SKIP_BUNDLE_DUMP-""} ]] || "${BIN_TOOL}" bundle:dump +"${BIN_TOOL}" feature:dump || true if [[ $(command -v jq) ]]; then OLDPWD=$(pwd) @@ -57,4 +59,11 @@ if [ ! -d vendor/shopware/administration/Resources/app/administration/node_modul npm install --prefix vendor/shopware/administration/Resources/app/administration/ fi +# Dump entity schema +if [[ -z "${SHOPWARE_SKIP_ENTITY_SCHEMA_DUMP-""}" ]] && [[ -f "${ADMIN_ROOT}"/Resources/app/administration/scripts/entitySchemaConverter/entity-schema-converter.ts ]]; then + mkdir -p "${ADMIN_ROOT}"/Resources/app/administration/test/_mocks_ + "${BIN_TOOL}" -e prod framework:schema -s 'entity-schema' "${ADMIN_ROOT}"/Resources/app/administration/test/_mocks_/entity-schema.json + (cd "${ADMIN_ROOT}"/Resources/app/administration && npm run convert-entity-schema) +fi + npm run --prefix vendor/shopware/administration/Resources/app/administration/ dev diff --git a/shopware/platform/6.4/bin/build-administration.sh b/shopware/platform/6.4/bin/build-administration.sh index 6f889dd..f135f88 100755 --- a/shopware/platform/6.4/bin/build-administration.sh +++ b/shopware/platform/6.4/bin/build-administration.sh @@ -2,6 +2,21 @@ CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" +export PROJECT_ROOT="${PROJECT_ROOT:-"$(dirname "$CWD")"}" +export ENV_FILE=${ENV_FILE:-"${PROJECT_ROOT}/.env"} + +# shellcheck source=functions.sh +source "${PROJECT_ROOT}/bin/functions.sh" + +curenv=$(declare -p -x) + +load_dotenv "$ENV_FILE" + +# Restore environment variables set globally +set -o allexport +eval "$curenv" +set +o allexport + set -euo pipefail export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true @@ -21,6 +36,7 @@ fi # build admin [[ ${SHOPWARE_SKIP_BUNDLE_DUMP-""} ]] || "${BIN_TOOL}" bundle:dump +"${BIN_TOOL}" feature:dump || true if [[ $(command -v jq) ]]; then OLDPWD=$(pwd) diff --git a/shopware/platform/6.4/bin/watch-administration.sh b/shopware/platform/6.4/bin/watch-administration.sh index 64d5a93..ea64fc1 100755 --- a/shopware/platform/6.4/bin/watch-administration.sh +++ b/shopware/platform/6.4/bin/watch-administration.sh @@ -22,8 +22,10 @@ export ESLINT_DISABLE export PORT export APP_URL -bin/console bundle:dump -bin/console feature:dump || true +BIN_TOOL="${CWD}/console" + +[[ ${SHOPWARE_SKIP_BUNDLE_DUMP-""} ]] || "${BIN_TOOL}" bundle:dump +"${BIN_TOOL}" feature:dump || true if [[ $(command -v jq) ]]; then OLDPWD=$(pwd) @@ -57,4 +59,11 @@ if [ ! -d vendor/shopware/administration/Resources/app/administration/node_modul npm install --prefix vendor/shopware/administration/Resources/app/administration/ fi +# Dump entity schema +if [[ -z "${SHOPWARE_SKIP_ENTITY_SCHEMA_DUMP-""}" ]] && [[ -f "${ADMIN_ROOT}"/Resources/app/administration/scripts/entitySchemaConverter/entity-schema-converter.ts ]]; then + mkdir -p "${ADMIN_ROOT}"/Resources/app/administration/test/_mocks_ + "${BIN_TOOL}" -e prod framework:schema -s 'entity-schema' "${ADMIN_ROOT}"/Resources/app/administration/test/_mocks_/entity-schema.json + (cd "${ADMIN_ROOT}"/Resources/app/administration && npm run convert-entity-schema) +fi + npm run --prefix vendor/shopware/administration/Resources/app/administration/ dev