Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEXT-30878 - fix admin build and watch #61

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion shopware/administration/6.4/bin/build-administration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
13 changes: 11 additions & 2 deletions shopware/administration/6.4/bin/watch-administration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
16 changes: 16 additions & 0 deletions shopware/platform/6.4/bin/build-administration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
13 changes: 11 additions & 2 deletions shopware/platform/6.4/bin/watch-administration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Loading