ACS-550 Test downstream repo update [skip tests] [no-release]

This commit is contained in:
Cezar.Leahu
2020-09-14 12:14:30 +03:00
parent 1067f9af20
commit 9838b0fe9e
2 changed files with 51 additions and 9 deletions

View File

@@ -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}"

View File

@@ -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>/,/<\/parent>/p' pom.xml \
| sed -n '/<version>/,/<\/version>/p' \
| tr -d '\n' \
| grep -oP '(?<=<version>).*(?=</version>)' \
| 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 =========================="