From 6ae9f88bb5edee2328cbb87c0032e343367bb414 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 2 Mar 2022 09:01:40 +0000 Subject: [PATCH] ACS-2608 Support force directive. --- .travis.yml | 2 +- scripts/travis/update_downstream.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8db70c5b46..1c595307b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ env: stages: - name: test - if: commit_message !~ /\[skip tests\]/ + if: commit_message !~ /\[skip tests\]/ AND commit_message !~ /\[force[^\]*]\]/ - name: release if: commit_message !~ /\[no release\]/ AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND fork = false - name: update_downstream diff --git a/scripts/travis/update_downstream.sh b/scripts/travis/update_downstream.sh index c81e0ac547..8946c6e295 100644 --- a/scripts/travis/update_downstream.sh +++ b/scripts/travis/update_downstream.sh @@ -33,7 +33,11 @@ git status git --no-pager diff pom.xml git add pom.xml -if git status --untracked-files=no --porcelain | grep -q '^' ; then +if [[ "${TRAVIS_COMMIT_MESSAGE}" =~ \[force[^\]]*\] ]]; then + forceToken=$(echo "${TRAVIS_COMMIT_MESSAGE}" | sed "s|^.*\(\[force[^]]*\]\).*$|\1|g") + git commit --allow-empty -m "${forceToken} Update upstream version to ${VERSION}" + git push +elif git status --untracked-files=no --porcelain | grep -q '^' ; then git commit -m "Update upstream version to ${VERSION}" git push else