Skip to content

Commit 558dfc5

Browse files
committed
#161 parameterize Dockerfile SQL scripts using dependency versions
1 parent 0aff959 commit 558dfc5

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

build-and-test-all.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ echo KEEP_RUNNING=$KEEP_RUNNING
2929

3030
# TODO Temporarily
3131

32-
./gradlew buildContracts
32+
./gradlew --parallel buildContracts
3333

34-
./gradlew compileAll
34+
./gradlew --parallel compileAll
3535

3636
if [ -z "$USE_EXISTING_CONTAINERS" ] ; then
37-
./gradlew composeDown
37+
./gradlew :composeDown
3838
fi
3939

4040
./gradlew infrastructureComposeUp
@@ -61,7 +61,7 @@ if [ -z "$ASSEMBLE_ONLY" ] ; then
6161

6262
./gradlew componentTest
6363

64-
./gradlew composeDown
64+
./gradlew :composeDown
6565

6666
else
6767
./gradlew $* assemble
@@ -77,5 +77,5 @@ fi
7777
# ./run-graphql-api-gateway-tests.sh
7878

7979
if [ -z "$KEEP_RUNNING" ] ; then
80-
./gradlew composeDown
80+
./gradlew :composeDown
8181
fi

build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ dockerCompose {
7979
if (project.hasProperty('startedServices'))
8080
startedServices= project.ext.startedServices.split(',')
8181

82+
mysql {
83+
projectName = null
84+
startedServices = ["mysql"]
85+
}
86+
8287
infrastructure {
8388
projectName = null
8489
startedServices = ["mysql", "cdc-service", "dynamodblocal-init", "kafka", "zookeeper"]

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ services:
2323
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
2424
KAFKA_HEAP_OPTS: -Xmx192m
2525
mysql:
26-
build: ./mysql
2726
build:
2827
context: ./mysql
2928
args:
3029
EVENTUATE_COMMON_VERSION: ${EVENTUATE_COMMON_VERSION?}
30+
EVENTUATE_SAGA_VERSION: ${EVENTUATE_SAGA_VERSION?}
3131
ports:
3232
- 3306:3306
3333
environment:

mysql/Dockerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
ARG EVENTUATE_COMMON_VERSION
22
FROM eventuateio/eventuate-mysql8:$EVENTUATE_COMMON_VERSION
3+
ARG EVENTUATE_COMMON_VERSION
4+
ARG EVENTUATE_SAGA_VERSION
5+
36
COPY compile-schema-per-service.sh /docker-entrypoint-initdb.d/4.compile-schema-per-service.sh
47

5-
ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/master/mysql/1.initialize-database.sql /docker-entrypoint-initdb.d/template1
6-
ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/master/mysql/2.initialize-database.sql /docker-entrypoint-initdb.d/template2
7-
ADD https://raw.githubusercontent.com/eventuate-tram/eventuate-tram-sagas/master/mysql/tram-saga-schema.sql /docker-entrypoint-initdb.d/template3
8+
ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/$EVENTUATE_COMMON_VERSION/mysql/1.initialize-database.sql /docker-entrypoint-initdb.d/template1
9+
ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/$EVENTUATE_COMMON_VERSION/mysql/2.initialize-database.sql /docker-entrypoint-initdb.d/template2
10+
ADD https://raw.githubusercontent.com/eventuate-tram/eventuate-tram-sagas/$EVENTUATE_SAGA_VERSION/mysql/tram-saga-schema.sql /docker-entrypoint-initdb.d/template3
811

9-
RUN cat /docker-entrypoint-initdb.d/template? | sed /eventuate/d > /docker-entrypoint-initdb.d/template
12+
RUN cat /docker-entrypoint-initdb.d/template? | sed -e 's/eventuate.offset_store/offset_store/' -e /eventuate/d > /docker-entrypoint-initdb.d/template
1013

1114
RUN touch /docker-entrypoint-initdb.d/5.schema-per-service.sql
1215
RUN chown mysql -R /docker-entrypoint-initdb.d

0 commit comments

Comments
 (0)