Skip to content

Moved ibexa/behat and ibexa/docker installation#73

Merged
micszo merged 1 commit intomainfrom
doctrine-bundle-order
Jun 12, 2023
Merged

Moved ibexa/behat and ibexa/docker installation#73
micszo merged 1 commit intomainfrom
doctrine-bundle-order

Conversation

@mnocon
Copy link
Copy Markdown
Contributor

@mnocon mnocon commented Jun 12, 2023

Both doctrine/doctrine-bundle and ibexa/docker define the database credentials in .env:

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
###< doctrine/doctrine-bundle ###
###> ibexa/docker ###
# Database configuration for Docker
DATABASE_USER=ezp
DATABASE_PASSWORD=SetYourOwnPassword
DATABASE_NAME=ezp
DATABASE_HOST=db
DATABASE_PORT=3306
DATABASE_PLATFORM=mysql
DATABASE_DRIVER=pdo_mysql
# Needed by Doctrine Bundle / ORM to avoid it opening connection during situations where there is no service yet.
# See: https://symfony.com/doc/current/reference/configuration/doctrine.html#doctrine-dbal-configuration
DATABASE_VERSION=mariadb-10.3.0
DATABASE_URL=${DATABASE_PLATFORM}://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}?serverVersion=${DATABASE_VERSION}
###< ibexa/docker ###

Only the last entry in .env is taken into account - that's why the recipe for ibexa/docker needs to be executed later than the doctrine-bundle one.

This fixes the issue I had in https://github.com/ibexa/visual-testing/pull/15 - the correct database credentials will be taken into account.

I had to remove the --no-update flag - in the previous version the packages were installed together with the edition, right now we're installing them separately (this ensures the correct recipe order).

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants