diff options
author | Michael Adam <obnox@samba.org> | 2020-03-21 00:07:16 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2020-03-21 01:23:43 +0100 |
commit | a52294cc261e97fe6fe175aa493a71b6e54213e5 (patch) | |
tree | 34b09ab56df52e9206b7ea7e8b10f07dd84c402c | |
parent | 43b5d911066cf23f523781403646e9c6245dafc0 (diff) | |
download | samba-integration-a52294cc261e97fe6fe175aa493a71b6e54213e5.tar.gz samba-integration-a52294cc261e97fe6fe175aa493a71b6e54213e5.tar.xz samba-integration-a52294cc261e97fe6fe175aa493a71b6e54213e5.zip |
centos-ci: execute PR version of the script if PR changed it
Signed-off-by: Michael Adam <obnox@samba.org>
-rwxr-xr-x | samba-integration-centos-ci-tests.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/samba-integration-centos-ci-tests.sh b/samba-integration-centos-ci-tests.sh index 3b16301..dc5f90a 100755 --- a/samba-integration-centos-ci-tests.sh +++ b/samba-integration-centos-ci-tests.sh @@ -13,6 +13,9 @@ set -x GIT_REPO_NAME="samba-integration" GIT_REPO_URL="https://github.com/gluster/${GIT_REPO_NAME}.git" TEST_TARGET="test" +SCRIPT_GIT_BRANCH="centos-ci" +SCRIPT_NAME="$(basename $0)" +SCRIPT_PATH="$(realpath $0)" # enable additional sources for yum # (SCL repository for Vagrant, epel for ansible) @@ -61,6 +64,17 @@ then echo "Unable to automatically rebase to branch '${ghprbTargetBranch}'. Please rebase your PR!" exit 1 fi + + # If the PR is on the branch that contains this script, + # and the script has changed in the PR, make sure we + # restart the PR version of the script to test the + # proposed changes, since the centos-ci is running + # the merged copy. + if [ "${ghprbTargetBranch}" = "${SCRIPT_GIT_BRANCH}" ]; then + if ! git diff --quiet ./"${SCRIPT_NAME}" "${SCRIPT_PATH}" ; then + exec "./${SCRIPT_NAME}" + fi + fi fi # Prefetch the centos/7 vagrant box. |