From 42267f0ff2bf1c5fa3bc65ddcc7f5a66ea609a08 Mon Sep 17 00:00:00 2001 From: Hai Liang Wang Date: Mon, 26 Dec 2022 13:25:20 +0800 Subject: [PATCH] https://github.com/cskefu/cskefu/issues/775 deploy before build image Signed-off-by: Hai Liang Wang --- server/bin/deploy.sh | 8 ++++++++ server/serving-api/bin/build.sh | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/server/bin/deploy.sh b/server/bin/deploy.sh index a23aabd0..25904b8f 100755 --- a/server/bin/deploy.sh +++ b/server/bin/deploy.sh @@ -18,3 +18,11 @@ export DATE_WITH_TIME=`date "+%Y%m%d-%H%M%S"` #add %3N as we want millisecond to [ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return cd $baseDir/.. mvn -DskipTests clean package deploy + +if [ $? -eq 0 ]; then + echo "Deploy success." + exit 0 +else + echo "Error happens during deployment." + exit 1 +fi \ No newline at end of file diff --git a/server/serving-api/bin/build.sh b/server/serving-api/bin/build.sh index 25e68c01..d9f96e6c 100755 --- a/server/serving-api/bin/build.sh +++ b/server/serving-api/bin/build.sh @@ -23,9 +23,17 @@ TIMESTAMP=`date "+%Y%m%d.%H%M%S"` PACKAGE_VERSION=`git rev-parse --short HEAD` APPLICATION_CUSTOMER_ENTITY=${APPLICATION_CUSTOMER_ENTITY:-"OpenSource Community"} +$baseDir/../../bin/deploy.sh + +if [ ! $? -eq 0 ]; then + echo "Error on deploy" + exit 1 +fi + $baseDir/package.sh if [ ! $? -eq 0 ]; then + echo "Error happens on package." exit 1 fi