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

@@ -39,7 +39,7 @@ jobs:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init" - name: "Init"
run: bash ./scripts/ci/init.sh run: bash ./scripts/ci/init.sh
- name: "Prepare environment" - name: "Prepare maven cache and check compilation"
run: bash ./scripts/ci/prepare.sh run: bash ./scripts/ci/prepare.sh
- name: "Clean Maven cache" - name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh run: bash ./scripts/ci/cleanup_cache.sh
@@ -528,4 +528,4 @@ jobs:
aws s3 cp --acl private solr.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/solr.log aws s3 cp --acl private solr.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/solr.log
aws s3 cp --acl private ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/rm-automation-community-rest-api.log aws s3 cp --acl private ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/rm-automation-community-rest-api.log
- name: "Clean Maven cache" - name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh run: bash ./scripts/ci/cleanup_cache.sh

View File

@@ -6,29 +6,21 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh" source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh"
if [[ -n ${BUILD_PROFILES} ]]; then
# Build the current project if needed PROFILES="${BUILD_PROFILES}"
if [[ -n ${REQUIRES_INSTALLED_ARTIFACTS} ]] || [[ -n ${REQUIRES_LOCAL_IMAGES} ]] || [[ -n ${BUILD_PROFILES} ]]; then elif [[ "${REQUIRES_LOCAL_IMAGES}" == "true" ]]; then
PROFILES="-Pbuild-docker-images -Pags"
if [[ -n ${BUILD_PROFILES} ]]; then else
PROFILES="${BUILD_PROFILES}" PROFILES="-Pags"
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
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
popd popd
set +vex set +vex

View File

@@ -23,9 +23,7 @@ if [ $M2_REPO_EXPIRED -eq 1 ];then
rm -rf "$M2_REPO_DIR" rm -rf "$M2_REPO_DIR"
fi fi
if [ $M2_REPO_FILE_COUNT -lt 1000 ] || [ $ORG_ALFRESCO_M2_REPO_EXPIRED -eq 1 ] || [ $M2_REPO_EXPIRED -eq 1 ];then echo "Verifying compilation and ensuring maven cache populated."
echo "Populating maven cache." export BUILD_PROFILES="-Pall-tas-tests,ags"
export BUILD_PROFILES="-Pall-tas-tests,ags" export BUILD_OPTIONS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dmaven.artifact.threads=8"
export BUILD_OPTIONS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dmaven.artifact.threads=8" source "$(dirname "${BASH_SOURCE[0]}")/build.sh"
source "$(dirname "${BASH_SOURCE[0]}")/build.sh"
fi