mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-457: Build linkage, tagging and release
- improvements on the build scripts
This commit is contained in:
@@ -21,7 +21,6 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- /release\/.*/
|
||||
- feature/ACS-457_travis-release-config
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -237,7 +236,6 @@ jobs:
|
||||
- name: "Push to Nexus"
|
||||
stage: release
|
||||
if: false
|
||||
install: travis_retry travis_wait 30 mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true -Pinternal
|
||||
before_script: bash scripts/travis/verify_release_tag.sh
|
||||
script: travis_wait 40 bash scripts/travis/maven_release.sh
|
||||
|
||||
|
@@ -2,7 +2,13 @@
|
||||
set -ev
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
|
||||
|
||||
PROFILES="$([ "${TRAVIS_BUILD_STAGE_NAME,,}" = "release" ] && echo "-Pinternal" || echo "-PcommunityDocker" )"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh"
|
||||
|
||||
if [ "${TRAVIS_BUILD_STAGE_NAME,,}" = "release" ] && [ "${TRAVIS_BRANCH}" = "master" ] && isBranchBuild ; then
|
||||
PROFILES="-Pinternal"
|
||||
else
|
||||
PROFILES="-PcommunityDocker"
|
||||
fi
|
||||
|
||||
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true "${PROFILES}"
|
||||
|
||||
|
@@ -65,6 +65,25 @@ function remoteBranchExists() {
|
||||
git ls-remote --exit-code --heads "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REMOTE_REPO}" "${BRANCH}"
|
||||
}
|
||||
|
||||
function identifyUpstreamSourceBranch() {
|
||||
local UPSTREAM_REPO="${1}"
|
||||
|
||||
# if it's a pull request, use the source branch name (if it exists)
|
||||
if isPullRequestBuild && remoteBranchExists "${UPSTREAM_REPO}" "${TRAVIS_PULL_REQUEST_BRANCH}" ; then
|
||||
echo "${TRAVIS_PULL_REQUEST_BRANCH}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# otherwise use the current branch name (or in case of PRs, the target branch name)
|
||||
if remoteBranchExists "${UPSTREAM_REPO}" "${TRAVIS_BRANCH}" ; then
|
||||
echo "${TRAVIS_BRANCH}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# if none of the previous exists, use the "master" branch
|
||||
echo "master"
|
||||
}
|
||||
|
||||
function pullUpstreamTag() {
|
||||
local UPSTREAM_REPO="${1}"
|
||||
local TAG="${2}"
|
||||
@@ -75,20 +94,8 @@ function pullUpstreamTag() {
|
||||
function pullAndBuildSameBranchOnUpstream() {
|
||||
local UPSTREAM_REPO="${1}"
|
||||
local EXTRA_BUILD_ARGUMENTS="${2}"
|
||||
local SOURCE_BRANCH="$(isBranchBuild && echo "${TRAVIS_BRANCH}" || echo "${TRAVIS_PULL_REQUEST_BRANCH}")"
|
||||
|
||||
if ! remoteBranchExists "${UPSTREAM_REPO}" "${SOURCE_BRANCH}" ; then
|
||||
printf "Branch \"%s\" not found on the %s repository\n" "${SOURCE_BRANCH}" "${UPSTREAM_REPO}"
|
||||
#exit 1
|
||||
fi
|
||||
|
||||
local SOURCE_BRANCH="${TRAVIS_BRANCH}"
|
||||
if ! remoteBranchExists "${UPSTREAM_REPO}" "${SOURCE_BRANCH}" ; then
|
||||
printf "Branch \"%s\" not found on the %s repository\n" "${SOURCE_BRANCH}" "${UPSTREAM_REPO}"
|
||||
#exit 1
|
||||
fi
|
||||
# TODO remove this line and enable the previous "exit" commands:
|
||||
local SOURCE_BRANCH="master"
|
||||
local SOURCE_BRANCH="$(identifyUpstreamSourceBranch "${UPSTREAM_REPO}")"
|
||||
|
||||
cloneRepo "${UPSTREAM_REPO}" "${SOURCE_BRANCH}"
|
||||
|
||||
|
Reference in New Issue
Block a user