Extract load_environment method

This commit is contained in:
Rohan Mitchell
2015-04-22 15:53:54 +10:00
parent 7aeeb6d18f
commit 92e03e208f
2 changed files with 8 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
function load_environment {
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
}
function exit_unless_master_merged {
if [[ `git branch -a --merged origin/$BUILDKITE_BRANCH` != *origin/master* ]]; then
echo "This branch does not have the current master merged. Please merge master and push again."

View File

@@ -4,10 +4,7 @@ set -e
echo "--- Loading environment"
source ./script/ci/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
load_environment
echo "--- Verifying branch is based on current master"
exit_unless_master_merged