File tree 5 files changed +30
-0
lines changed
ftgo-order-history-service
src/integration-test/java/net/chrisrichardson/ftgo/cqrs/orderhistory/dynamodb
5 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ COPY create-dynamodb-tables.sh .
4
4
COPY ftgo-order-history.json .
5
5
COPY wait-for-dynamodblocal.sh .
6
6
RUN chmod +x *.sh
7
+ HEALTHCHECK --interval=10s --retries=10 --timeout=3s CMD [[ -f /tables-created ]]
8
+
7
9
CMD ./wait-for-dynamodblocal.sh && ./create-dynamodb-tables.sh
Original file line number Diff line number Diff line change @@ -10,3 +10,10 @@ echo creating table
10
10
aws dynamodb $* create-table --region us-west-2 --endpoint-url ${AWS_DYNAMODB_ENDPOINT_URL?} --cli-input-json file://ftgo-order-history.json
11
11
12
12
fi
13
+
14
+ touch /tables-created
15
+
16
+ while [[ true ]] ; do
17
+ echo sleeping...
18
+ sleep 3600
19
+ done
Original file line number Diff line number Diff line change 1
1
FROM amazon/dynamodb-local:1.11.477
2
2
ENTRYPOINT java -jar DynamoDBLocal.jar -inMemory -sharedDb -port 8000
3
+ HEALTHCHECK --start-period=5s --interval=5s CMD curl http://localhost:8000 || exit 1
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ buildscript {
3
3
dependencies {
4
4
classpath " io.spring.gradle:dependency-management-plugin:$springDependencyManagementPluginVersion "
5
5
classpath " org.springframework.cloud:spring-cloud-contract-gradle-plugin:$springCloudContractDependenciesVersion "
6
+ classpath " com.avast.gradle:gradle-docker-compose-plugin:$dockerComposePluginVersion "
6
7
}
7
8
repositories {
8
9
mavenCentral()
@@ -13,6 +14,8 @@ buildscript {
13
14
apply plugin : FtgoServicePlugin
14
15
apply plugin : " io.spring.dependency-management"
15
16
apply plugin : ' spring-cloud-contract'
17
+ apply plugin : IntegrationTestsPlugin
18
+ apply plugin : ' docker-compose'
16
19
17
20
dependencyManagement {
18
21
imports {
@@ -53,3 +56,20 @@ dependencies {
53
56
54
57
55
58
}
59
+
60
+ dockerCompose {
61
+
62
+ startedServices = [' not-used' ]
63
+
64
+ integrationTests {
65
+ if (System . getenv(" FTGO_DOCKER_COMPOSE_FILES" ) != null )
66
+ useComposeFiles = System . getenv(" FTGO_DOCKER_COMPOSE_FILES" ). split(" ," ). collect { " ../" + it }
67
+
68
+ startedServices = [' dynamodblocal' , ' dynamodblocal-init' ]
69
+ stopContainers = true
70
+ }
71
+ }
72
+
73
+ integrationTest. dependsOn(integrationTestsComposeUp)
74
+
75
+
File renamed without changes.
You can’t perform that action at this time.
0 commit comments