From d0452aaddb6091973823393c83cb2d5e641bbac3 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 22 Mar 2022 10:45:16 +0000 Subject: [PATCH] Revert "Revert "ACS-2608 Support force directive. (#992)"" This reverts commit 464db778fa5a52e51cb4d11da060083965eb1604. --- .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 2bb797ed32..ada2a08956 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..b4316a0307 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 + FORCE_TOKEN=$(echo "${TRAVIS_COMMIT_MESSAGE}" | sed "s|^.*\(\[force[^]]*\]\).*$|\1|g") + git commit --allow-empty -m "${FORCE_TOKEN} 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