Files
acs-community-packaging/scripts/travis/build.sh
CezarLeahu f394b39114 ACS-457: Build linkage, tagging and release (#991)
* ACS-457: Build linkage, tagging and release

- update .travis.settings.xml

* ACS-457: Build linkage, tagging and release

- add cleanup_cache.sh script

* ACS-457: Build linkage, tagging and release

- add init.sh script for before_install job phases

* ACS-457: Build linkage, tagging and release

- add build.sh script for install job phases

* ACS-457: Build linkage, tagging and release

- minor updates on the older travis and veracode scripts

* ACS-457: Build linkage, tagging and release

- reorganized and updated .travis.yml

* ACS-457: Build linkage, tagging and release

- update and propagate branch version numbers during the build

* ACS-457: Build linkage, tagging and release

- enable docker image squash for all image builds

* ACS-457: Build linkage, tagging and release

- shellcheck CI scripts

* ACS-457: Build linkage, tagging and release

- handle upstream versions in chained feature branch builds

* ACS-457: Build linkage, tagging and release

- switch to TEST pom versions

* ACS-457: Build linkage, tagging and release

- handle pom properties for upstream dependencies in build.sh scripts

* ACS-457: Build linkage, tagging and release

- post-merge fixes

* ACS-457: Build linkage, tagging and release

- clone upstream repositories with "--depth=1" (no history needed)
- add "-Dmaven.javadoc.skip=true" options in the build scripts

* ACS-457: Build linkage, tagging and release

- remove <scm> configuration from sub-modules
- remove <distributionManagement> configurations from submodules
- remove <repository> configuration from poms
- remove unnecessary and unused POM profiles

* ACS-457: Build linkage, tagging and release

- add pom <pluginManagement> section
- removed some plugin versions from downstream modules
- add a single common configuration for the *maven-relese-plugin*

* ACS-457: Build linkage, tagging and release

- update and reorganize the fabric8-maven-plugin configuration

* ACS-457: Build linkage, tagging and release

- add configurable docker upstream.image.tag property

* ACS-457: Build linkage, tagging and release

- modify the build.sh scripts so they checkout the upstream project tag

* ACS-457: Build linkage, tagging and release

- re-implement build.sh script logic to support PRs & branch builds
- restricted the build.sh script capabilities
- moved build functions to a separate .sh file

* ACS-457: Build linkage, tagging and release

- update release scripts

* ACS-457: Build linkage, tagging and release

- debug build scripts

* ACS-457: Build linkage, tagging and release

- fix build scripts

* ACS-457: Build linkage, tagging and release

- fix build scripts

* ACS-457: Build linkage, tagging and release

- setup/update the S3 publishing jobs

* ACS-457: Build linkage, tagging and release

- add missing profile

* ACS-457: Build linkage, tagging and release

- disable PR merges with SNAPSHOT dependencies (on master|release/*)

* ACS-457: Build linkage, tagging and release

- made the upstream cloning (build_functions.sh) more lenient

* ACS-457: Build linkage, tagging and release

- fix scripting bug (execute function in sub-shell)
2020-08-12 02:41:55 +03:00

35 lines
1.4 KiB
Bash

#!/usr/bin/env bash
set -ev
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh"
DEPENDENCY_VERSION="$(retrievePomProperty "dependency.alfresco-community-repo.version")"
# Either both the parent and the upstream dependency are the same, or else fail the build
if [ "${DEPENDENCY_VERSION}" != "$(retrievePomParentVersion)" ]; then
printf "Upstream dependency version (%s) is different then the project parent version!\n" "${DEPENDENCY_VERSION}"
exit 1
fi
# Prevent merging of any SNAPSHOT dependencies into the master or the release/* branches
if [[ $(isPullRequestBuild) && "${DEPENDENCY_VERSION}" =~ ^.+-SNAPSHOT$ && "${TRAVIS_BRANCH}" =~ ^master$|^release/.+$ ]] ; then
printf "PRs with SNAPSHOT dependencies are not allowed into master or release branches\n"
exit 1
fi
UPSTREAM_REPO="github.com/Alfresco/alfresco-community-repo.git"
# Search, checkout and build the same branch on the upstream project in case of SNAPSHOT dependencies
# Otherwise just checkout the upstream dependency sources
if [[ "${DEPENDENCY_VERSION}" =~ ^.+-SNAPSHOT$ ]] ; then
pullAndBuildSameBranchOnUpstream "${UPSTREAM_REPO}" "-PcommunityDocker"
else
pullUpstreamTag "${UPSTREAM_REPO}" "${DEPENDENCY_VERSION}"
fi
# Build the current project
mvn -B -V -q install -DskipTests -Dmaven.javadoc.skip=true -PcommunityDocker \
$([[ "${DEPENDENCY_VERSION}" =~ ^.+-SNAPSHOT$ ]] && echo "-Dupstream.image.tag=latest")