ACS-4464 Always build application when build or prepare are called.

If build is called then we definitely should be building the application. When prepare is called then we want to
prevent further builds running if the application doesn't compile.
This commit is contained in:
Tom Page
2023-01-24 10:54:47 +00:00
parent 6841388b4f
commit d7edaa5eaf
3 changed files with 19 additions and 29 deletions

View File

@@ -6,29 +6,21 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh"
# Build the current project if needed
if [[ -n ${REQUIRES_INSTALLED_ARTIFACTS} ]] || [[ -n ${REQUIRES_LOCAL_IMAGES} ]] || [[ -n ${BUILD_PROFILES} ]]; then
if [[ -n ${BUILD_PROFILES} ]]; then
PROFILES="${BUILD_PROFILES}"
else
if [[ "${REQUIRES_LOCAL_IMAGES}" == "true" ]]; then
PROFILES="-Pbuild-docker-images -Pags"
else
PROFILES="-Pags"
fi
fi
if [[ "${REQUIRES_INSTALLED_ARTIFACTS}" == "true" ]]; then
PHASE="install"
else
PHASE="package"
fi
mvn -B -V $PHASE -DskipTests -Dmaven.javadoc.skip=true $PROFILES $BUILD_OPTIONS
if [[ -n ${BUILD_PROFILES} ]]; then
PROFILES="${BUILD_PROFILES}"
elif [[ "${REQUIRES_LOCAL_IMAGES}" == "true" ]]; then
PROFILES="-Pbuild-docker-images -Pags"
else
PROFILES="-Pags"
fi
if [[ "${REQUIRES_INSTALLED_ARTIFACTS}" == "true" ]]; then
PHASE="install"
else
PHASE="package"
fi
mvn -B -V $PHASE -DskipTests -Dmaven.javadoc.skip=true $PROFILES $BUILD_OPTIONS
popd
set +vex