Skip to content
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
59217a3
first poc draft
tomaszszopinski Jun 23, 2025
0b579e9
review changes
tomaszszopinski Jun 23, 2025
f4d61d9
Additional CR
tomaszszopinski Jun 23, 2025
5a2c72c
Commented composer version checks
tomaszszopinski Jun 23, 2025
12bc10d
syntax fix
tomaszszopinski Jun 23, 2025
b85b8ee
Update bin/5.0.x-dev/prepare_project_edition.sh
tomaszszopinski Jun 24, 2025
3f64aa8
Update bin/5.0.x-dev/prepare_project_edition.sh
tomaszszopinski Jun 24, 2025
fd52d00
Initialized db container
tomaszszopinski Jun 24, 2025
305dae8
added db credentials
tomaszszopinski Jun 24, 2025
b57bd1d
removed space
tomaszszopinski Jun 24, 2025
735ad89
restored space
tomaszszopinski Jun 24, 2025
46fa936
Hardcoded credentials added
tomaszszopinski Jun 24, 2025
a1fa501
db password syntax fixed
tomaszszopinski Jun 24, 2025
d26d737
doctrine:database:import approach
tomaszszopinski Jun 24, 2025
2724381
added doctrine bundle
tomaszszopinski Jun 25, 2025
38b5e98
lowered doctrine bundle reqs
tomaszszopinski Jun 25, 2025
76f1555
doctrine:query attempt
tomaszszopinski Jun 25, 2025
8d62b3c
removed doctrine bundle requirement
tomaszszopinski Jun 25, 2025
03b191f
added behat recipes reinstall
tomaszszopinski Jun 26, 2025
be59ca0
recreating behat.yaml after recipes
tomaszszopinski Jun 26, 2025
ae3cd42
added permissions to behat.yaml
tomaszszopinski Jun 26, 2025
9638e1d
another approach to permissions
tomaszszopinski Jun 26, 2025
536a32a
fixed syntax
tomaszszopinski Jun 26, 2025
742c12a
more yaml removal
tomaszszopinski Jun 26, 2025
1634acc
current state commit before recipes
tomaszszopinski Jun 26, 2025
6fda762
commented current state commit
tomaszszopinski Jun 27, 2025
84bcc87
added touch behat.yaml
tomaszszopinski Jun 27, 2025
b3e3809
modified yaml deletion
tomaszszopinski Jun 27, 2025
10e77f7
added behat oss config removal
tomaszszopinski Jun 27, 2025
8727182
added composer require for behat 5.0
tomaszszopinski Jun 27, 2025
012fbee
added missing sql schemas
tomaszszopinski Jun 27, 2025
bf481d4
changed to doctrine.schema.dump-sql
tomaszszopinski Jun 27, 2025
4136e6f
another syntax change to schemas dumping
tomaszszopinski Jun 27, 2025
96273de
improved schema syntax
tomaszszopinski Jun 27, 2025
42e65b1
added reindex
tomaszszopinski Jun 27, 2025
1acaee1
Added TMP Dependency
mnocon Jun 30, 2025
c77cc16
Fixed escaping
mnocon Jun 30, 2025
a86e2dd
Remove cache dir
mnocon Jun 30, 2025
a0c7404
Do not rebuild the cache
mnocon Jun 30, 2025
d4b7ceb
Added missing date and time
mnocon Jun 30, 2025
4a8573a
Test PostgreSQL script
mnocon Jun 30, 2025
68ab437
Added discounts
mnocon Jun 30, 2025
cd86518
Added comment
mnocon Jun 30, 2025
860c9c8
Clear redis cache
mnocon Jun 30, 2025
07759ef
Removed one TMP dependency
mnocon Jun 30, 2025
a62e3b3
Removed TMP changes
mnocon Jul 3, 2025
e35aa28
Removed require ibexa/graphql
micszo Jul 7, 2025
5910823
Added cache:pool:clear before generate-schema
micszo Jul 8, 2025
68f3c2c
Apply suggestion from @adriendupuis
mnocon Jul 9, 2025
843c916
Added installer dependency
mnocon Jul 9, 2025
fd8c5c9
prepare_project_edition.sh: More migration files
adriendupuis Jul 10, 2025
75cb196
update to symfony 7.3
tomaszszopinski Jul 16, 2025
3298624
removed installer dependencies
tomaszszopinski Jul 23, 2025
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
156 changes: 146 additions & 10 deletions bin/5.0.x-dev/prepare_project_edition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

PROJECT_EDITION=$1
PROJECT_VERSION=$2
PROJECT_VERSION=4.6.x-dev
PROJECT_BUILD_DIR=${HOME}/build/project
export COMPOSE_FILE=$3
export PHP_IMAGE=${4-ghcr.io/ibexa/docker/php:8.3-node18}
Expand Down Expand Up @@ -91,15 +91,15 @@ if [[ "$PROJECT_EDITION" != "oss" ]]; then
mv composer.json.new composer.json
fi

echo "> Make composer use tested dependency"
JSON_STRING=$( jq -n \
--arg packageVersion "$DEPENDENCY_PACKAGE_VERSION" \
--arg packageName "$DEPENDENCY_PACKAGE_NAME" \
--arg packageDir "./$DEPENDENCY_PACKAGE_NAME" \
'{"type": "path", "url": $packageDir, "options": { "symlink": false , "versions": { ($packageName): $packageVersion}}}' )
# echo "> Make composer use tested dependency"
# JSON_STRING=$( jq -n \
# --arg packageVersion "$DEPENDENCY_PACKAGE_VERSION" \
# --arg packageName "$DEPENDENCY_PACKAGE_NAME" \
# --arg packageDir "./$DEPENDENCY_PACKAGE_NAME" \
# '{"type": "path", "url": $packageDir, "options": { "symlink": false , "versions": { ($packageName): $packageVersion}}}' )

composer config repositories.localDependency "$JSON_STRING"
composer require "$DEPENDENCY_PACKAGE_NAME:$DEPENDENCY_PACKAGE_VERSION" --no-update
# composer config repositories.localDependency "$JSON_STRING"
# composer require "$DEPENDENCY_PACKAGE_NAME:$DEPENDENCY_PACKAGE_VERSION" --no-update

# Install correct product variant
docker exec install_dependencies composer require ibexa/${PROJECT_EDITION}:${PROJECT_VERSION} -W --no-scripts --ansi
Expand Down Expand Up @@ -140,7 +140,8 @@ echo "> Display composer.json for debugging"
cat composer.json

# Create a default Behat configuration file
cp "behat_ibexa_${PROJECT_EDITION}.yaml" behat.yaml
touch behat.yaml
# cp "behat_ibexa_${PROJECT_EDITION}.yaml" behat.yaml

# Depenencies are installed and container can be removed
docker container stop install_dependencies
Expand Down Expand Up @@ -180,4 +181,139 @@ fi
echo '> Generate GraphQL schema'
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:graphql:generate-schema"

########################################################################################################################

# Delete old GraphQL schema
docker compose --env-file=.env exec -T --user www-data app sh -c "rm -r config/graphql"

# Remove Stimulus bootstrap
docker compose --env-file=.env exec -T --user www-data app sh -c "rm assets/bootstrap.js"
docker compose --env-file=.env exec -T --user www-data app sh -c "sed -i '/bootstrap/d' assets/app.js"
docker compose --env-file=.env exec -T --user www-data app sh -c "sed -i '/start the Stimulus application/d' assets/app.js"

# Move from annotation to attribute
#docker compose sed -i 's/type: annotation/type: attribute/g' config/routes/annotations.yaml
docker compose --env-file=.env exec -T --user www-data app sh -c "rm config/routes/annotations.yaml"
docker compose --env-file=.env exec -T --user www-data app sh -c "rm config/routes.yaml"

# TMP: Accept dev version (5.0.x-dev)
docker compose --env-file=.env exec -T --user www-data app sh -c "composer config minimum-stability dev"

# Update required PHP version
docker compose --env-file=.env exec -T --user www-data app sh -c "composer require --no-update 'php:>=8.3'"
# Update required Symfony version
docker compose --env-file=.env exec -T --user www-data app sh -c "composer config extra.symfony.require '7.3.*'"

echo "> Remove cache dir"
docker compose --env-file=.env exec -T --user www-data app sh -c "rm -rf var/cache/*"
docker compose --env-file=.env exec -T --user www-data app sh -c "rm -rf var/cache/behat/*"

# Upgrade Ibexa and Symfony packages (main app)
docker compose --env-file=.env exec -T --user www-data app sh -c "composer require --no-update \
ibexa/commerce:5.0.x-dev \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ibexa/commerce:5.0.x-dev \
ibexa/commerce:5.0.x-dev \
ibexa/behat:5.0.x-dev \
ibexa/docker:5.0.x-dev \

We will probably need to update these as well

ibexa/behat:5.0.x-dev \
ibexa/docker:5.0.x-dev \
symfony/console:^7.3 \
symfony/dotenv:^7.3 \
symfony/framework-bundle:^7.3 \
symfony/runtime:^7.3 \
symfony/yaml:^7.3 \
;"

# TMP: admin-ui-assets and headless-assets need to be on a tag
docker compose --env-file=.env exec -T --user www-data app sh -c "composer require --no-update \
ibexa/admin-ui-assets:v5.0.0-rc1 \
ibexa/headless-assets:v5.0.0-rc1 \
;"

# Upgrade Ibexa and Symfony packages (dev tools)
docker compose --env-file=.env exec -T --user www-data app sh -c "composer require --dev --no-update \
ibexa/rector:5.0.x-dev \
symfony/debug-bundle:^7.3 \
symfony/stopwatch:^7.3 \
symfony/web-profiler-bundle:^7.3 \
;"

# Remove Php82HideDeprecationsErrorHandler
docker compose --env-file=.env exec -T --user www-data app sh -c "composer config --unset extra.runtime.error_handler"

# Update packages / Install new dependencies
docker compose --env-file=.env exec -T --user www-data app sh -c "composer update --with-all-dependencies --no-scripts --verbose"

# TMP: Move to development recipes
docker compose --env-file=.env exec -T --user www-data app sh -c "composer config extra.symfony.endpoint \"https://api.github.com/repos/ibexa/recipes-dev/contents/index.json?ref=flex/main\""
# Reset recipes
docker compose --env-file=.env exec -T --user www-data app sh -c "rm symfony.lock"
# Run recipes
docker compose --env-file=.env exec -T --user www-data app sh -c "composer recipes:install ibexa/commerce --force --yes -v"

# Swap tsconfig.json usage and creation
docker compose --env-file=.env exec -T --user www-data app sh -c "perl -0pe 's/\"ibexa:encore:compile --config-name\": \"symfony-cmd\",\n\s+\"yarn ibexa-generate-tsconfig\": \"script\"/\"yarn ibexa-generate-tsconfig\": \"script\",\n \"ibexa:encore:compile\": \"symfony-cmd\"/gms' -i composer.json"

docker compose --env-file=.env exec -T --user www-data app sh -c "perl -ne 'print unless /IbexaIconsBundle/' -i config/bundles.php"


# Manually clear cache to ensure scripts won't use a piece of it
docker compose --env-file=.env exec -T --user www-data app sh -c "rm -rf var/cache"

# A.k.a "auto-scripts" (mainly JS and assets stuffs)
docker compose --env-file=.env exec -T --user www-data app sh -c "composer run-script post-update-cmd"

# Database update
# docker exec ibexa-db-1 sh -c "mysql -u ezp -pSetYourOwnPassword"
# docker compose --env-file=.env exec -T --user www-data app sh -c "mysql < vendor/ibexa/installer/upgrade/db/mysql/ibexa-4.6.latest-to-5.0.0.sql"

echo '> Update database schema'
if [[ "$COMPOSE_FILE" == *"db-postgresql.yml"* ]]; then
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(cat vendor/ibexa/installer/upgrade/db/postgresql/ibexa-4.6.latest-to-5.0.0.sql | grep -v '\-- ')\""
else
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(cat vendor/ibexa/installer/upgrade/db/mysql/ibexa-4.6.latest-to-5.0.0.sql | grep -v '\-- ')\""
fi

# LTS Update related schemas to inject only if the add-on was never installed
# keep an eye!
#ddev php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | ddev mysql

docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml)\""
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml)\""
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/connector-ai/src/bundle/Resources/config/schema.yaml)\""
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/product-catalog-date-time-attribute/src/bundle/Resources/config/schema.yaml)\""
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/discounts/src/bundle/Resources/config/schema.yaml)\""
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console doctrine:query:sql \"\$(php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/discounts-codes/src/bundle/Resources/config/schema.yaml)\""

# docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml"
# docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/connector-ai/src/bundle/Resources/config/schema.yaml"
#ddev php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | ddev mysql
#ddev php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/connector-ai/src/bundle/Resources/config/schema.yaml | ddev mysql

# Clear persistence cache pool (when using Redis or Memcached)
if [[ "$COMPOSE_FILE" == *"redis.yml"* ]]; then
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console cache:pool:clear --all"
fi

# Migration (update 'company' content type)
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:migrations:import vendor/ibexa/corporate-account/src/bundle/Resources/migrations/2025_07_08_09_27_set_container_to_company.yaml"
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:migrations:migrate --file=2025_07_08_09_27_set_container_to_company.yaml --siteaccess=admin"
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:migrations:import vendor/ibexa/product-catalog/src/bundle/Resources/migrations/2025_07_09_13_52_mark_product_category_container.yaml"
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:migrations:migrate --file=2025_07_09_13_52_mark_product_category_container.yaml --siteaccess=admin"
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:migrations:import vendor/ibexa/taxonomy/src/bundle/Resources/install/migrations/2025_08_09_14_47_mark_tag_as_container.yaml"
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:migrations:migrate --file=2025_08_09_14_47_mark_tag_as_container.yaml --siteaccess=admin"

# Generate new GraphQL schema if used (while admin-ui doesn't use it anymore)
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:graphql:generate-schema"

# reindex
docker compose --env-file=.env exec -T --user www-data app sh -c "php bin/console ibexa:reindex"

docker compose --env-file=.env exec -T --user www-data app sh -c "rm -rf behat_ibexa_commerce.yaml"
docker compose --env-file=.env exec -T --user www-data app sh -c "rm -rf behat_ibexa_oss.yaml"
# docker compose --env-file=.env exec -T --user www-data app sh -c "git add . && git commit -m 'current state'"


docker compose --env-file=.env exec -T --user www-data app sh -c "composer require --dev ibexa/behat:~5.0.x-dev --no-scripts --no-plugins"
docker compose --env-file=.env exec -T --user www-data app sh -c "composer recipes:install ibexa/behat --force --reset -vv"

docker compose --env-file=.env exec -T --user www-data app sh -c "cp behat_ibexa_commerce.yaml behat.yaml"


echo '> Done, ready to run tests'
Loading