-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-build.sh
executable file
·20 lines (16 loc) · 1.03 KB
/
docker-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
DOCKER_IMAGE_PREFIX="ivanfranchin"
APP_VERSION="1.0.0"
PRODUCER_APP_NAME="producer-service"
CONSUMER_APP_NAME="consumer-service"
PRODUCER_DOCKER_IMAGE_NAME="${DOCKER_IMAGE_PREFIX}/${PRODUCER_APP_NAME}:${APP_VERSION}"
CONSUMER_DOCKER_IMAGE_NAME="${DOCKER_IMAGE_PREFIX}/${CONSUMER_APP_NAME}:${APP_VERSION}"
SKIP_TESTS="true"
if [ "$1" = "native" ];
then
./mvnw -Pnative clean spring-boot:build-image --projects "$PRODUCER_APP_NAME" -DskipTests="$SKIP_TESTS" -Dspring-boot.build-image.imageName="$PRODUCER_DOCKER_IMAGE_NAME"
./mvnw -Pnative clean spring-boot:build-image --projects "$CONSUMER_APP_NAME" -DskipTests="$SKIP_TESTS" -Dspring-boot.build-image.imageName="$CONSUMER_DOCKER_IMAGE_NAME"
else
./mvnw clean spring-boot:build-image --projects "$PRODUCER_APP_NAME" -DskipTests="$SKIP_TESTS" -Dspring-boot.build-image.imageName="$PRODUCER_DOCKER_IMAGE_NAME"
./mvnw clean spring-boot:build-image --projects "$CONSUMER_APP_NAME" -DskipTests="$SKIP_TESTS" -Dspring-boot.build-image.imageName="$CONSUMER_DOCKER_IMAGE_NAME"
fi