From ed1023f75b1b50849ef1acc9628f675aec7fa569 Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Mon, 3 Oct 2022 12:02:26 -0700 Subject: [PATCH 01/11] Upgrade snapshot versions --- gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index b7ae0b3e..76414ff0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,14 +11,14 @@ springCloudContractDependenciesVersion=2.2.0.RELEASE springDependencyManagementPluginVersion=1.0.3.RELEASE -eventuateCommonVersion=0.15.0.RELEASE -eventuatePlatformVersion=2022.0.RELEASE +eventuateCommonVersion=0.16.0.BUILD-SNAPSHOT +eventuatePlatformVersion=2022.1.BUILD-SNAPSHOT -eventuateCommonImageVersion=0.15.0.RELEASE -eventuateMessagingKafkaImageVersion=0.15.0.RELEASE -eventuateCdcImageVersion=0.13.0.RELEASE -eventuateTramSagasImageVersion=0.19.0.RELEASE +eventuateCommonImageVersion=0.16.0.BUILD-SNAPSHOT +eventuateMessagingKafkaImageVersion=0.16.0.BUILD-SNAPSHOT +eventuateCdcImageVersion=0.14.0.BUILD-SNAPSHOT +eventuateTramSagasImageVersion=0.20.0.BUILD-SNAPSHOT protocVersion=3.20.1 grpcVersion = 1.47.0 @@ -31,8 +31,8 @@ springCloudSleuthVersion=2.2.2.RELEASE springCloudGatewayVersion=2.0.0.RELEASE micrometerVersion=1.0.4 -microserviceCanvasVersion=0.8.0.RELEASE +microserviceCanvasVersion=0.9.0.BUILD-SNAPSHOT swaggerRequestValidatorVersion=2.8.3 js2pVersion=1.0.1 -eventuatePlatformVersion=2022.0.RELEASE +eventuatePlatformVersion=2022.1.BUILD-SNAPSHOT From 3acd5f3bcbc7745d4e5055d242b9964911ab0260 Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Thu, 6 Oct 2022 09:33:13 -0700 Subject: [PATCH 02/11] Upgrade snapshot versions --- gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index 76414ff0..5b73e75e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,14 +11,14 @@ springCloudContractDependenciesVersion=2.2.0.RELEASE springDependencyManagementPluginVersion=1.0.3.RELEASE -eventuateCommonVersion=0.16.0.BUILD-SNAPSHOT -eventuatePlatformVersion=2022.1.BUILD-SNAPSHOT +eventuateCommonVersion=0.16.0.RELEASE +eventuatePlatformVersion=2022.2.BUILD-SNAPSHOT -eventuateCommonImageVersion=0.16.0.BUILD-SNAPSHOT -eventuateMessagingKafkaImageVersion=0.16.0.BUILD-SNAPSHOT -eventuateCdcImageVersion=0.14.0.BUILD-SNAPSHOT -eventuateTramSagasImageVersion=0.20.0.BUILD-SNAPSHOT +eventuateCommonImageVersion=0.16.0.RELEASE +eventuateMessagingKafkaImageVersion=0.16.0.RELEASE +eventuateCdcImageVersion=0.14.0.RELEASE +eventuateTramSagasImageVersion=0.20.0.RELEASE protocVersion=3.20.1 grpcVersion = 1.47.0 @@ -31,8 +31,8 @@ springCloudSleuthVersion=2.2.2.RELEASE springCloudGatewayVersion=2.0.0.RELEASE micrometerVersion=1.0.4 -microserviceCanvasVersion=0.9.0.BUILD-SNAPSHOT +microserviceCanvasVersion=0.9.0.RELEASE swaggerRequestValidatorVersion=2.8.3 js2pVersion=1.0.1 -eventuatePlatformVersion=2022.1.BUILD-SNAPSHOT +eventuatePlatformVersion=2022.2.BUILD-SNAPSHOT From f9c77f8b3c990464813ea78ce1ac6785fbff976c Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Thu, 6 Oct 2022 15:21:05 -0700 Subject: [PATCH 03/11] Upgrade to RELEASE versions --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5b73e75e..fa1886f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ springCloudContractDependenciesVersion=2.2.0.RELEASE springDependencyManagementPluginVersion=1.0.3.RELEASE eventuateCommonVersion=0.16.0.RELEASE -eventuatePlatformVersion=2022.2.BUILD-SNAPSHOT +eventuatePlatformVersion=2022.2.RELEASE eventuateCommonImageVersion=0.16.0.RELEASE @@ -35,4 +35,4 @@ microserviceCanvasVersion=0.9.0.RELEASE swaggerRequestValidatorVersion=2.8.3 js2pVersion=1.0.1 -eventuatePlatformVersion=2022.2.BUILD-SNAPSHOT +eventuatePlatformVersion=2022.2.RELEASE From 1ec7adc9ee3d0dffc1fdb1ab87d2bd9a53f3ad1f Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Mon, 27 Feb 2023 20:15:49 -0800 Subject: [PATCH 04/11] Added logo --- README.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.adoc b/README.adoc index f878f3d2..31da6157 100644 --- a/README.adoc +++ b/README.adoc @@ -1,3 +1,9 @@ += An Eventuate project + +image::https://eventuate.io/i/logo.gif[] + +This project is part of http://eventuate.io[Eventuate], which is a microservices collaboration platform. + = FTGO example application This is the example code for my book https://microservices.io/book[Microservice patterns]. From 8a5ea65e5360c128e24f60c30b41eda8a4c86ba4 Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Sat, 25 Mar 2023 12:05:03 +0900 Subject: [PATCH 05/11] Upgrade Orb --- .circleci/config.yml | 2 +- .circleci/generate-config.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4534586d..dd84fd06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 setup: true orbs: - eventuate-gradle-build-and-test: "eventuate_io/eventuate-gradle-build-and-test@0.2.1" + eventuate-gradle-build-and-test: "eventuate_io/eventuate-gradle-build-and-test@0.2.7" continuation: circleci/continuation@0.1.2 jobs: setup: diff --git a/.circleci/generate-config.sh b/.circleci/generate-config.sh index 12bbcc7d..633fa6e1 100755 --- a/.circleci/generate-config.sh +++ b/.circleci/generate-config.sh @@ -3,7 +3,7 @@ cat > generated_config.yml < Date: Wed, 3 May 2023 15:29:22 -0700 Subject: [PATCH 06/11] Upgraded eventuate dependencies --- gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index fa1886f1..cd04c5a5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,14 +11,14 @@ springCloudContractDependenciesVersion=2.2.0.RELEASE springDependencyManagementPluginVersion=1.0.3.RELEASE -eventuateCommonVersion=0.16.0.RELEASE -eventuatePlatformVersion=2022.2.RELEASE +eventuateCommonVersion=0.17.0.RELEASE +eventuatePlatformVersion=2023.0.RELEASE -eventuateCommonImageVersion=0.16.0.RELEASE -eventuateMessagingKafkaImageVersion=0.16.0.RELEASE -eventuateCdcImageVersion=0.14.0.RELEASE -eventuateTramSagasImageVersion=0.20.0.RELEASE +eventuateCommonImageVersion=0.17.0.RELEASE +eventuateMessagingKafkaImageVersion=0.17.0.RELEASE +eventuateCdcImageVersion=0.15.0.RELEASE +eventuateTramSagasImageVersion=0.21.0.RELEASE protocVersion=3.20.1 grpcVersion = 1.47.0 @@ -31,8 +31,8 @@ springCloudSleuthVersion=2.2.2.RELEASE springCloudGatewayVersion=2.0.0.RELEASE micrometerVersion=1.0.4 -microserviceCanvasVersion=0.9.0.RELEASE +microserviceCanvasVersion=0.10.0.RELEASE swaggerRequestValidatorVersion=2.8.3 js2pVersion=1.0.1 -eventuatePlatformVersion=2022.2.RELEASE +eventuatePlatformVersion=2023.0.RELEASE From 6546361f09aaae1b66133441035af9d37047342f Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Mon, 3 Jul 2023 12:04:05 +0900 Subject: [PATCH 07/11] Upgraded Docker Compose Gradle plugin to support homebrew installation https://github.com/eventuate-tram/eventuate-development/issues/1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index cd04c5a5..df4663be 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ grpcVersion = 1.47.0 swaggerUiVersion=3.23.11 eventuateExamplesBaseImageVersion=BUILD-15 -dockerComposePluginVersion=0.15.2 +dockerComposePluginVersion=0.16.12 springCloudSleuthVersion=2.2.2.RELEASE springCloudGatewayVersion=2.0.0.RELEASE micrometerVersion=1.0.4 From 396936d242f7c4794c685ef5470513b4964a35fe Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Fri, 15 Sep 2023 17:17:10 -0700 Subject: [PATCH 08/11] Upgraded eventuate dependencies --- gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index df4663be..3ebefe2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,14 +11,14 @@ springCloudContractDependenciesVersion=2.2.0.RELEASE springDependencyManagementPluginVersion=1.0.3.RELEASE -eventuateCommonVersion=0.17.0.RELEASE -eventuatePlatformVersion=2023.0.RELEASE +eventuateCommonVersion=0.18.0.RELEASE +eventuatePlatformVersion=2023.1.RELEASE -eventuateCommonImageVersion=0.17.0.RELEASE -eventuateMessagingKafkaImageVersion=0.17.0.RELEASE -eventuateCdcImageVersion=0.15.0.RELEASE -eventuateTramSagasImageVersion=0.21.0.RELEASE +eventuateCommonImageVersion=0.18.0.RELEASE +eventuateMessagingKafkaImageVersion=0.18.0.RELEASE +eventuateCdcImageVersion=0.16.0.RELEASE +eventuateTramSagasImageVersion=0.23.0.RELEASE protocVersion=3.20.1 grpcVersion = 1.47.0 @@ -31,8 +31,8 @@ springCloudSleuthVersion=2.2.2.RELEASE springCloudGatewayVersion=2.0.0.RELEASE micrometerVersion=1.0.4 -microserviceCanvasVersion=0.10.0.RELEASE +microserviceCanvasVersion=0.11.0.RELEASE swaggerRequestValidatorVersion=2.8.3 js2pVersion=1.0.1 -eventuatePlatformVersion=2023.0.RELEASE +eventuatePlatformVersion=2023.1.RELEASE From 59d3c82713e7ed1a28e28b5e9c31dc12c31bf00a Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Wed, 20 Sep 2023 12:07:04 -0700 Subject: [PATCH 09/11] WIP updated Eventuate dependencies => updating to use flyway to create service schemas - requires https://github.com/eventuate-local/eventuate-local/issues/238 --- build.gradle | 9 ++++++++- buildSrc/src/main/groovy/FtgoServicePlugin.groovy | 3 +++ docker-compose.yml | 3 ++- dynamodblocal-init/Dockerfile | 2 +- .../accountingservice/main/AccountingServiceMain.java | 4 +++- .../src/main/resources/application.properties | 5 +++++ .../ftgo/consumerservice/main/ConsumerServiceMain.java | 3 ++- .../src/main/resources/application.properties | 5 +++++ .../ftgo/deliveryservice/main/DeliveryServiceMain.java | 3 ++- .../src/main/resources/application.properties | 5 +++++ .../ftgo/kitchenservice/main/KitchenServiceMain.java | 4 +++- .../src/main/resources/application.properties | 5 +++++ .../ftgo/orderservice/main/OrderServiceMain.java | 3 ++- .../src/main/resources/application.properties | 5 +++++ .../ftgo/restaurantservice/RestaurantServiceMain.java | 3 ++- .../src/main/resources/application.properties | 5 +++++ mysql/Dockerfile | 9 ++------- mysql/compile-schema-per-service.sh | 1 - 18 files changed, 60 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 28274e56..eba006fb 100644 --- a/build.gradle +++ b/build.gradle @@ -86,7 +86,14 @@ dockerCompose { infrastructure { projectName = null - startedServices = ["mysql", "cdc-service", "dynamodblocal-init", "kafka", "zookeeper"] + startedServices = ["mysql", "dynamodblocal-init", "kafka", "zookeeper"] + } + + // TODO with flyway - initialize after services + + eventuateCdcService { + projectName = null + startedServices = ["cdc-service"] } kafkaGui { diff --git a/buildSrc/src/main/groovy/FtgoServicePlugin.groovy b/buildSrc/src/main/groovy/FtgoServicePlugin.groovy index 7f8dfbc9..99b494af 100644 --- a/buildSrc/src/main/groovy/FtgoServicePlugin.groovy +++ b/buildSrc/src/main/groovy/FtgoServicePlugin.groovy @@ -28,6 +28,9 @@ class FtgoServicePlugin implements Plugin { compile 'org.springframework.cloud:spring-cloud-starter-zipkin' compile "io.zipkin.brave:brave-bom:4.17.1" + implementation "io.eventuate.tram.core:eventuate-tram-spring-flyway" + runtimeOnly "io.eventuate.tram.sagas:eventuate-tram-sagas-spring-flyway" + // Temporarily disable //compile "io.eventuate.tram.core:eventuate-tram-spring-cloud-sleuth-integration" diff --git a/docker-compose.yml b/docker-compose.yml index a9e55b0d..0bc3ce7c 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -77,7 +77,8 @@ services: EVENTUATE_CDC_PIPELINE_PIPELINE8_EVENTUATEDATABASESCHEMA: ftgo_delivery_service EVENTUATE_CDC_READER_READER1_TYPE: mysql-binlog - EVENTUATE_CDC_READER_READER1_DATASOURCEURL: jdbc:mysql://mysql:3306/eventuate + EVENTUATE_CDC_READER_READER1_DATASOURCEURL: jdbc:mysql://mysql:3306/ftgo_delivery_service + EVENTUATE_CDC_READER_READER1_MONITORINGSCHEMA: ftgo_delivery_service EVENTUATE_CDC_READER_READER1_DATASOURCEUSERNAME: root EVENTUATE_CDC_READER_READER1_DATASOURCEPASSWORD: rootpassword EVENTUATE_CDC_READER_READER1_DATASOURCEDRIVERCLASSNAME: com.mysql.jdbc.Driver diff --git a/dynamodblocal-init/Dockerfile b/dynamodblocal-init/Dockerfile index 0b242f5a..ef48933e 100644 --- a/dynamodblocal-init/Dockerfile +++ b/dynamodblocal-init/Dockerfile @@ -1,4 +1,4 @@ -FROM python:2.7.16-alpine3.9 +FROM python:3.11.5-alpine3.18 RUN pip install awscli --upgrade COPY create-dynamodb-tables.sh . COPY ftgo-order-history.json . diff --git a/ftgo-accounting-service/src/main/java/net/chrisrichardson/ftgo/accountingservice/main/AccountingServiceMain.java b/ftgo-accounting-service/src/main/java/net/chrisrichardson/ftgo/accountingservice/main/AccountingServiceMain.java index cb1ece2a..b3096455 100644 --- a/ftgo-accounting-service/src/main/java/net/chrisrichardson/ftgo/accountingservice/main/AccountingServiceMain.java +++ b/ftgo-accounting-service/src/main/java/net/chrisrichardson/ftgo/accountingservice/main/AccountingServiceMain.java @@ -10,6 +10,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration; @Configuration @EnableAutoConfiguration @@ -17,7 +18,8 @@ TramCommandProducerConfiguration.class, EventuateDriverConfiguration.class, TramJdbcKafkaConfiguration.class, - CommonSwaggerConfiguration.class}) + CommonSwaggerConfiguration.class, + EventuateTramFlywayMigrationConfiguration.class}) public class AccountingServiceMain { public static void main(String[] args) { diff --git a/ftgo-accounting-service/src/main/resources/application.properties b/ftgo-accounting-service/src/main/resources/application.properties index 70c4dcd6..66908780 100644 --- a/ftgo-accounting-service/src/main/resources/application.properties +++ b/ftgo-accounting-service/src/main/resources/application.properties @@ -15,3 +15,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181 + +spring.flyway.locations=classpath:flyway/{vendor} +spring.flyway.baseline-on-migrate=true +spring.flyway.baseline-version=0 + diff --git a/ftgo-consumer-service/src/main/java/net/chrisrichardson/ftgo/consumerservice/main/ConsumerServiceMain.java b/ftgo-consumer-service/src/main/java/net/chrisrichardson/ftgo/consumerservice/main/ConsumerServiceMain.java index d5b85881..3e61202a 100644 --- a/ftgo-consumer-service/src/main/java/net/chrisrichardson/ftgo/consumerservice/main/ConsumerServiceMain.java +++ b/ftgo-consumer-service/src/main/java/net/chrisrichardson/ftgo/consumerservice/main/ConsumerServiceMain.java @@ -6,9 +6,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; +import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration; @SpringBootApplication -@Import({ConsumerWebConfiguration.class, TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({ConsumerWebConfiguration.class, TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class, EventuateTramFlywayMigrationConfiguration.class}) public class ConsumerServiceMain { public static void main(String[] args) { diff --git a/ftgo-consumer-service/src/main/resources/application.properties b/ftgo-consumer-service/src/main/resources/application.properties index 1afc72aa..677de018 100644 --- a/ftgo-consumer-service/src/main/resources/application.properties +++ b/ftgo-consumer-service/src/main/resources/application.properties @@ -15,3 +15,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181 + +spring.flyway.locations=classpath:flyway/{vendor} +spring.flyway.baseline-on-migrate=true +spring.flyway.baseline-version=0 + diff --git a/ftgo-delivery-service/src/main/java/net/chrisrichardson/ftgo/deliveryservice/main/DeliveryServiceMain.java b/ftgo-delivery-service/src/main/java/net/chrisrichardson/ftgo/deliveryservice/main/DeliveryServiceMain.java index 0a468e7d..3e5e9ecb 100644 --- a/ftgo-delivery-service/src/main/java/net/chrisrichardson/ftgo/deliveryservice/main/DeliveryServiceMain.java +++ b/ftgo-delivery-service/src/main/java/net/chrisrichardson/ftgo/deliveryservice/main/DeliveryServiceMain.java @@ -8,11 +8,12 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration; @Configuration @EnableAutoConfiguration @Import({DeliveryServiceMessagingConfiguration.class, DeliveryServiceWebConfiguration.class, - TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class + TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class, EventuateTramFlywayMigrationConfiguration.class }) public class DeliveryServiceMain { diff --git a/ftgo-delivery-service/src/main/resources/application.properties b/ftgo-delivery-service/src/main/resources/application.properties index 1ad5dce5..ab2ac983 100644 --- a/ftgo-delivery-service/src/main/resources/application.properties +++ b/ftgo-delivery-service/src/main/resources/application.properties @@ -21,3 +21,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181 + +spring.flyway.locations=classpath:flyway/{vendor} +spring.flyway.baseline-on-migrate=true +spring.flyway.baseline-version=0 + diff --git a/ftgo-kitchen-service/src/main/java/net/chrisrichardson/ftgo/kitchenservice/main/KitchenServiceMain.java b/ftgo-kitchen-service/src/main/java/net/chrisrichardson/ftgo/kitchenservice/main/KitchenServiceMain.java index ee00bfd7..24132232 100644 --- a/ftgo-kitchen-service/src/main/java/net/chrisrichardson/ftgo/kitchenservice/main/KitchenServiceMain.java +++ b/ftgo-kitchen-service/src/main/java/net/chrisrichardson/ftgo/kitchenservice/main/KitchenServiceMain.java @@ -7,12 +7,14 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; +import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration; @SpringBootApplication @Import({KitchenServiceWebConfiguration.class, KitchenServiceMessageHandlersConfiguration.class, TramJdbcKafkaConfiguration.class, - CommonSwaggerConfiguration.class}) + CommonSwaggerConfiguration.class, + EventuateTramFlywayMigrationConfiguration.class}) public class KitchenServiceMain { public static void main(String[] args) { diff --git a/ftgo-kitchen-service/src/main/resources/application.properties b/ftgo-kitchen-service/src/main/resources/application.properties index 09c3fd86..78a41836 100644 --- a/ftgo-kitchen-service/src/main/resources/application.properties +++ b/ftgo-kitchen-service/src/main/resources/application.properties @@ -16,3 +16,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181 + +spring.flyway.locations=classpath:flyway/{vendor} +spring.flyway.baseline-on-migrate=true +spring.flyway.baseline-version=0 + diff --git a/ftgo-order-service/src/main/java/net/chrisrichardson/ftgo/orderservice/main/OrderServiceMain.java b/ftgo-order-service/src/main/java/net/chrisrichardson/ftgo/orderservice/main/OrderServiceMain.java index 9249122c..13876e3d 100644 --- a/ftgo-order-service/src/main/java/net/chrisrichardson/ftgo/orderservice/main/OrderServiceMain.java +++ b/ftgo-order-service/src/main/java/net/chrisrichardson/ftgo/orderservice/main/OrderServiceMain.java @@ -11,11 +11,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; +import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration; @SpringBootApplication @Import({OrderWebConfiguration.class, OrderCommandHandlersConfiguration.class, OrderServiceMessagingConfiguration.class, TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class, GrpcConfiguration.class, - MicroserviceCanvasWebConfiguration.class}) + MicroserviceCanvasWebConfiguration.class, EventuateTramFlywayMigrationConfiguration.class}) @ServiceDescription(description="Manages Orders", capabilities = "Order Management") public class OrderServiceMain { diff --git a/ftgo-order-service/src/main/resources/application.properties b/ftgo-order-service/src/main/resources/application.properties index 89121df7..769bacb8 100644 --- a/ftgo-order-service/src/main/resources/application.properties +++ b/ftgo-order-service/src/main/resources/application.properties @@ -21,3 +21,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181 + +spring.flyway.locations=classpath:flyway/{vendor} +spring.flyway.baseline-on-migrate=true +spring.flyway.baseline-version=0 + diff --git a/ftgo-restaurant-service/src/main/java/net/chrisrichardson/ftgo/restaurantservice/RestaurantServiceMain.java b/ftgo-restaurant-service/src/main/java/net/chrisrichardson/ftgo/restaurantservice/RestaurantServiceMain.java index 557bcab9..6b3015af 100644 --- a/ftgo-restaurant-service/src/main/java/net/chrisrichardson/ftgo/restaurantservice/RestaurantServiceMain.java +++ b/ftgo-restaurant-service/src/main/java/net/chrisrichardson/ftgo/restaurantservice/RestaurantServiceMain.java @@ -8,9 +8,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Primary; +import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration; @SpringBootApplication -@Import(TramJdbcKafkaConfiguration.class) +@Import({TramJdbcKafkaConfiguration.class, EventuateTramFlywayMigrationConfiguration.class}) public class RestaurantServiceMain { @Bean diff --git a/ftgo-restaurant-service/src/main/resources/application.properties b/ftgo-restaurant-service/src/main/resources/application.properties index b1085fc2..22f0f67d 100644 --- a/ftgo-restaurant-service/src/main/resources/application.properties +++ b/ftgo-restaurant-service/src/main/resources/application.properties @@ -16,3 +16,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092 eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181 + +spring.flyway.locations=classpath:flyway/{vendor} +spring.flyway.baseline-on-migrate=true +spring.flyway.baseline-version=0 + diff --git a/mysql/Dockerfile b/mysql/Dockerfile index 3e91971b..39cefd24 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -1,15 +1,10 @@ ARG EVENTUATE_COMMON_VERSION -FROM eventuateio/eventuate-mysql8:$EVENTUATE_COMMON_VERSION +FROM eventuateio/eventuate-vanilla-mysql8:$EVENTUATE_COMMON_VERSION ARG EVENTUATE_COMMON_VERSION ARG EVENTUATE_SAGA_VERSION COPY compile-schema-per-service.sh /docker-entrypoint-initdb.d/4.compile-schema-per-service.sh -ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/$EVENTUATE_COMMON_VERSION/mysql/1.initialize-database.sql /docker-entrypoint-initdb.d/template1 -ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/$EVENTUATE_COMMON_VERSION/mysql/2.initialize-database.sql /docker-entrypoint-initdb.d/template2 -ADD https://raw.githubusercontent.com/eventuate-tram/eventuate-tram-sagas/$EVENTUATE_SAGA_VERSION/mysql/tram-saga-schema.sql /docker-entrypoint-initdb.d/template3 - -RUN cat /docker-entrypoint-initdb.d/template? | sed -e 's/eventuate.offset_store/offset_store/' -e /eventuate/d > /docker-entrypoint-initdb.d/template - RUN touch /docker-entrypoint-initdb.d/5.schema-per-service.sql + RUN chown mysql -R /docker-entrypoint-initdb.d diff --git a/mysql/compile-schema-per-service.sh b/mysql/compile-schema-per-service.sh index 6d1d3697..8d63ef40 100644 --- a/mysql/compile-schema-per-service.sh +++ b/mysql/compile-schema-per-service.sh @@ -10,5 +10,4 @@ do GRANT ALL PRIVILEGES ON $schema.* TO '${user}'@'%' WITH GRANT OPTION; USE $schema; END - cat /docker-entrypoint-initdb.d/template >> /docker-entrypoint-initdb.d/5.schema-per-service.sql done From ca2ea7e35f84e9dbbed95c639348ba43c25b6cfd Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Thu, 13 Mar 2025 09:27:28 +0900 Subject: [PATCH 10/11] upgrade Orb --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd84fd06..9fcc9ba7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 setup: true orbs: - eventuate-gradle-build-and-test: "eventuate_io/eventuate-gradle-build-and-test@0.2.7" + eventuate-gradle-build-and-test: "eventuate_io/eventuate-gradle-build-and-test@0.2.9" continuation: circleci/continuation@0.1.2 jobs: setup: From 519919e8b24382e04d7c9755f459f2b607ac5cf9 Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Thu, 13 Mar 2025 09:38:17 +0900 Subject: [PATCH 11/11] upgrade Orb --- .circleci/generate-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/generate-config.sh b/.circleci/generate-config.sh index 633fa6e1..38a9003b 100755 --- a/.circleci/generate-config.sh +++ b/.circleci/generate-config.sh @@ -3,7 +3,7 @@ cat > generated_config.yml <