APPS-900 APPS-894 APPS-889 Simplify maven POM setup. Reorganize build stages

* remove unnecessary build environment variables
* add a LOG_WARN environment variable - for shorter build commands
* split the `release.sh` script into `community_release.sh` and `enterprise_release.sh`
* remove usage of the `-Dcommunity` build variable where not needed - use/exclude the `-Penterprise` profile explicitly where needed
* modify the Travis `install` phase on some jobs so it runs a basic Java compilation of the project (without docker)
* remove the *internal* profile and renamed the *master* profile into *publish-docker-latest*
* modifiy the profiles for the docker builds so that the same profile handles both community (DockerHub&Quay) and enteprise (only Quay) docker image deploys
* run all the _Unit&Integration Tests_ across community&enteprise in one single job, in parallel with the REST API & UI test suites (APPS-889)
* reorganize the job order so that the *Tests* stage is the first one executed (APPS-894)
* only run the *Maven&Docker deploy* tasks on the *master* & *release* branches after the *Tests* stage (APPS-894)
This commit is contained in:
Cezar.Leahu
2021-03-17 18:56:11 +02:00
parent 2b8a8abc32
commit 3e57490e04
12 changed files with 121 additions and 226 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
# Use full history for release
git checkout -B "${TRAVIS_BRANCH}"
git config user.email "${GIT_EMAIL}"
if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ]; then
echo "Please provide a Release and Development version"
exit 1
fi
mvn -B \
-Dusername="${GIT_USERNAME}" \
-Dpassword="${GIT_PASSWORD}" \
-DreleaseVersion=${RELEASE_VERSION} \
-DdevelopmentVersion=${DEVELOPMENT_VERSION} \
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
-DuseReleaseProfile=false \
"-Darguments=-DskipTests -P\!enterprise -Prelease-community,community-release" \
release:clean release:prepare release:perform

View File

@@ -1,41 +0,0 @@
#!/usr/bin/env bash
set -e
# Use full history for release
git checkout -B "${TRAVIS_BRANCH}"
git config user.email "build@alfresco.com"
release_type=$1
echo Release type: "$release_type"
if [ -z $release_type ]; then
echo "Please provide a release type."
exit 1
elif [ $release_type != "community" -a $release_type != "enterprise" ]; then
echo "The provided release type is not valid."
exit 1
fi
if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ]; then
echo "Please provide a Release and Development verison"
exit 1
fi
# Check if it's a hotfix version by counting the number of dots in the version number.
if [ $(echo "${RELEASE_VERSION}" | grep -o "\." | wc -l) == 3 ] && [ ${release_type} == "enterprise" ];
then
deployment_repository="hotfix-release"
else
deployment_repository="${release_type}-release"
fi
mvn --batch-mode \
-Dusername="${GIT_USERNAME}" \
-Dpassword="${GIT_PASSWORD}" \
-DreleaseVersion=${RELEASE_VERSION} \
-DdevelopmentVersion=${DEVELOPMENT_VERSION} \
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
-DuseReleaseProfile=false \
"-Darguments=-DskipTests -D${release_type} -P${deployment_repository},release-${release_type}" \
release:clean release:prepare release:perform

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
echo "Branch name: ${TRAVIS_BRANCH}"
echo "Pull request: ${TRAVIS_PULL_REQUEST}"
echo "Travis job name: ${TRAVIS_JOB_NAME}"
echo "Image tag: ${TRAVIS_BRANCH:8}"
if [[ ${TRAVIS_JOB_NAME} == "Build AGS Enterprise" ]] ; then
export BUILD_PROFILE="internal"
else
export BUILD_PROFILE="master"
fi
if [[ "${TRAVIS_BRANCH}" == "master" && "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then
export MAVEN_PHASE="deploy"
export IMAGE_TAG="latest"
elif [[ ${TRAVIS_BRANCH} = release* && "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then
export MAVEN_PHASE="deploy"
export IMAGE_TAG="${TRAVIS_BRANCH:8}-latest"
else
export MAVEN_PHASE="verify"
export BUILD_PROFILE="buildDockerImage"
export IMAGE_TAG="latest"
fi