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

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