diff --git a/.travis.yml b/.travis.yml index 1ad141e5c2..b7d382eaad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,10 @@ stages: if: commit_message !~ /\[skip tests\]/ - name: release if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no-release\]/ + - name: update_downstream + if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no-downstream\]/ - name: trigger_downstream - if: fork = false AND type != pull_request AND commit_message !~ /\[no-downstream\]/ + if: fork = false AND (branch != master OR branch !~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no-downstream\]/ before_install: travis_retry bash scripts/travis/init.sh install: travis_retry bash scripts/travis/build.sh @@ -237,17 +239,15 @@ jobs: before_script: bash scripts/travis/verify_release_tag.sh script: travis_wait 40 bash scripts/travis/maven_release.sh + - name: "Update alfresco-enterprise-repo" + stage: update_downstream + before_install: skip + install: skip + script: bash scripts/travis/update_downstream.sh + - name: "Trigger alfresco-enterprise-repo build" stage: trigger_downstream before_install: skip install: skip script: bash scripts/travis/trigger_travis.sh "Alfresco" "alfresco-enterprise-repo" "${TRAVIS_BRANCH}" - # TODO enable or delete job - - name: "Trigger acs-community-packaging build" - stage: trigger_downstream - if: false - before_install: skip - install: skip - script: bash scripts/travis/trigger_travis.sh "Alfresco" "acs-community-packaging" "${TRAVIS_BRANCH}" - diff --git a/scripts/travis/update_downstream.sh b/scripts/travis/update_downstream.sh new file mode 100644 index 0000000000..57d38f2025 --- /dev/null +++ b/scripts/travis/update_downstream.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +echo "=========================== Starting Update Downstream Script ===========================" +PS4="\[\e[35m\]+ \[\e[m\]" +set -vex +pushd "$(dirname "${BASH_SOURCE[0]}")/../../" + +source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh" + +DOWNSTREAM_REPO="github.com/Alfresco/alfresco-enterprise-repo.git" + +cloneRepo "${DOWNSTREAM_REPO}" "${TRAVIS_BRANCH}" + +cd "$(dirname "${BASH_SOURCE[0]}")/../../../$(basename "${DOWNSTREAM_REPO%.git}")" + +# Update parent +mvn versions:update-parent versions:commit + +VERSION="$(sed -n '//,/<\/parent>/p' pom.xml \ + | sed -n '//,/<\/version>/p' \ + | tr -d '\n' \ + | grep -oP '(?<=).*(?=)' \ + | xargs)" + +# Update dependency version +mvn versions:set-property versions:commit \ + -Dproperty=dependency.alfresco-community-repo.version \ + "-DnewVersion=${VERSION}" + +# Commit changes +git status +git --no-pager diff pom.xml +git add pom.xml +git commit -m "Update upstream version to ${VERSION}" +#todo enable this +#git push +git status + + +popd +set +vex +echo "=========================== Finishing Update Downstream Script ==========================" +