From 8c5bbe28d86c83ee7a4035bcca782cd3637087a3 Mon Sep 17 00:00:00 2001 From: David Badura Date: Sun, 28 Apr 2024 20:38:05 +0200 Subject: [PATCH] add patchlevel/event-sourcing 3.0 (#1611) --- .../packages/patchlevel_event_sourcing.yaml | 21 +++++++++ .../event-sourcing-bundle/3.0/manifest.json | 43 +++++++++++++++++++ .../3.0/post-install.txt | 1 + 3 files changed, 65 insertions(+) create mode 100644 patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml create mode 100644 patchlevel/event-sourcing-bundle/3.0/manifest.json create mode 100644 patchlevel/event-sourcing-bundle/3.0/post-install.txt diff --git a/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml b/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml new file mode 100644 index 00000000..961c9c4e --- /dev/null +++ b/patchlevel/event-sourcing-bundle/3.0/config/packages/patchlevel_event_sourcing.yaml @@ -0,0 +1,21 @@ +patchlevel_event_sourcing: + aggregates: '%kernel.project_dir%/src' + events: '%kernel.project_dir%/src' + connection: + url: '%env(EVENTSTORE_URL)%' + +when@dev: + patchlevel_event_sourcing: + subscription: + catch_up: true + throw_on_error: true + run_after_aggregate_save: true + rebuild_after_file_change: true + auto_setup: true + +when@test: + patchlevel_event_sourcing: + subscription: + catch_up: true + throw_on_error: true + run_after_aggregate_save: true diff --git a/patchlevel/event-sourcing-bundle/3.0/manifest.json b/patchlevel/event-sourcing-bundle/3.0/manifest.json new file mode 100644 index 00000000..7e41e9cb --- /dev/null +++ b/patchlevel/event-sourcing-bundle/3.0/manifest.json @@ -0,0 +1,43 @@ +{ + "bundles": { + "Patchlevel\\EventSourcingBundle\\PatchlevelEventSourcingBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url", + "#3": "", + "#4": "EVENTSTORE_URL=\"pdo-sqlite:///%kernel.project_dir%/var/data.db\"", + "#5": "EVENTSTORE_URL=\"pdo-mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.2\"", + "EVENTSTORE_URL": "pdo-pgsql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" + }, + "dockerfile": [ + "RUN install-php-extensions pdo_pgsql" + ], + "docker-compose": { + "docker-compose.yml": { + "services": [ + "database:", + " image: postgres:${POSTGRES_VERSION:-16}-alpine", + " environment:", + " POSTGRES_DB: ${POSTGRES_DB:-app}", + " # You should definitely change the password in production", + " POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}", + " POSTGRES_USER: ${POSTGRES_USER:-app}", + " volumes:", + " - database_data:/var/lib/postgresql/data:rw", + " # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!", + " # - ./docker/db/data:/var/lib/postgresql/data:rw" + ], + "volumes": ["database_data:"] + }, + "docker-compose.override.yml": { + "services": [ + "database:", + " ports:", + " - \"5432\"" + ] + } + } +} diff --git a/patchlevel/event-sourcing-bundle/3.0/post-install.txt b/patchlevel/event-sourcing-bundle/3.0/post-install.txt new file mode 100644 index 00000000..af47860c --- /dev/null +++ b/patchlevel/event-sourcing-bundle/3.0/post-install.txt @@ -0,0 +1 @@ + * Modify your EVENTSTORE_URL config in .env