File tree 3 files changed +15
-20
lines changed
3 files changed +15
-20
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- ./mvnw clean compile jib:dockerBuild --projects author-book-api
4
- ./mvnw clean compile jib:dockerBuild --projects book-review-api
3
+ DOCKER_IMAGE_PREFIX=" ivanfranchin"
4
+ APP_VERSION=" 1.0.0"
5
+
6
+ AUTHOR_BOOK_API_APP_NAME=" author-book-api"
7
+ BOOK_REVIEW_API_APP_NAME=" book-review-api"
8
+
9
+ AUTHOR_BOOK_API_DOCKER_IMAGE_NAME=" ${DOCKER_IMAGE_PREFIX} /${AUTHOR_BOOK_API_APP_NAME} :${APP_VERSION} "
10
+ BOOK_REVIEW_API_DOCKER_IMAGE_NAME=" ${DOCKER_IMAGE_PREFIX} /${BOOK_REVIEW_API_APP_NAME} :${APP_VERSION} "
11
+
12
+ SKIP_TESTS=" true"
13
+
14
+ ./mvnw clean spring-boot:build-image --projects " $AUTHOR_BOOK_API_APP_NAME " -DskipTests=" $SKIP_TESTS " -Dspring-boot.build-image.imageName=" $AUTHOR_BOOK_API_DOCKER_IMAGE_NAME "
15
+ ./mvnw clean spring-boot:build-image --projects " $BOOK_REVIEW_API_APP_NAME " -DskipTests=" $SKIP_TESTS " -Dspring-boot.build-image.imageName=" $BOOK_REVIEW_API_DOCKER_IMAGE_NAME "
Original file line number Diff line number Diff line change 22
22
<spring-cloud .version>2023.0.3</spring-cloud .version>
23
23
<org .mapstruct.version>1.6.3</org .mapstruct.version>
24
24
<lombok-mapstruct-binding .version>0.2.0</lombok-mapstruct-binding .version>
25
- <jib-maven-plugin .version>3.4.4</jib-maven-plugin .version>
26
- <jdk-image .version>21.0.5</jdk-image .version>
27
- <docker-image .prefix>ivanfranchin</docker-image .prefix>
28
25
</properties >
29
26
30
27
<modules >
95
92
</annotationProcessorPaths >
96
93
</configuration >
97
94
</plugin >
98
- <plugin >
99
- <groupId >com.google.cloud.tools</groupId >
100
- <artifactId >jib-maven-plugin</artifactId >
101
- <version >${jib-maven-plugin.version} </version >
102
- <configuration >
103
- <from >
104
- <image >amazoncorretto:${jdk-image.version} </image >
105
- </from >
106
- <to >
107
- <image >${docker-image.prefix} /${project.artifactId} :${project.version} </image >
108
- </to >
109
- </configuration >
110
- </plugin >
111
95
</plugins >
112
96
</build >
113
97
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ echo "Starting author-book-api ..."
8
8
docker run -d --rm --name author-book-api -p 8080:8080 \
9
9
-e MYSQL_HOST=mysql -e ZIPKIN_HOST=zipkin -e BOOK_REVIEW_API_HOST=book-review-api -e SPRING_DATASOURCE_USERNAME=authorbookuser -e SPRING_DATASOURCE_PASSWORD=authorbookpass \
10
10
--network=springboot-graphql-databases_default \
11
- --health-cmd=" curl -f http:// localhost:8080/actuator/health || exit 1" \
11
+ --health-cmd=' [ -z "$(echo "" > /dev/tcp/ localhost/8080)" ] || exit 1' \
12
12
ivanfranchin/author-book-api:1.0.0
13
13
14
14
wait_for_container_log " author-book-api" " Started"
@@ -19,7 +19,7 @@ echo "Starting book-review-api ..."
19
19
docker run -d --rm --name book-review-api -p 9080:9080 \
20
20
-e MONGODB_HOST=mongodb -e ZIPKIN_HOST=zipkin -e SPRING_DATA_MONGODB_USERNAME=bookreviewuser -e SPRING_DATA_MONGODB_PASSWORD=bookreviewpass \
21
21
--network=springboot-graphql-databases_default \
22
- --health-cmd=" curl -f http:// localhost:9080/actuator/health || exit 1" \
22
+ --health-cmd=' [ -z "$(echo "" > /dev/tcp/ localhost/9080)" ] || exit 1' \
23
23
ivanfranchin/book-review-api:1.0.0
24
24
25
25
wait_for_container_log " book-review-api" " Started"
You can’t perform that action at this time.
0 commit comments