From d406f9ccdf599b630b547d4f6dba7ae4e3ffd6d3 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 22 Apr 2015 13:14:51 +1000 Subject: [PATCH] Tests fail unless master has been merged into current branch --- script/includes.sh | 6 ++++++ script/run_tests.sh | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 script/includes.sh diff --git a/script/includes.sh b/script/includes.sh new file mode 100644 index 0000000000..1b0519f940 --- /dev/null +++ b/script/includes.sh @@ -0,0 +1,6 @@ +function exit_unless_master_merged { + if [[ `git branch -a --merged $BUILDKITE_BRANCH` != *origin/master* ]]; then + echo "This branch does not have the current master merged. Please merge master and push again." + exit 1 + fi +} diff --git a/script/run_tests.sh b/script/run_tests.sh index 461ca4ecd8..616d454e5d 100755 --- a/script/run_tests.sh +++ b/script/run_tests.sh @@ -3,11 +3,15 @@ set -e echo "--- Loading environment" +source ./script/includes.sh source /var/lib/jenkins/.rvm/environments/ruby-1.9.3-p392 if [ ! -f config/application.yml ]; then ln -s application.yml.example config/application.yml fi +echo "--- Verifying branch is based on current master" +exit_unless_master_merged + echo "--- Bundling" bundle install