mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add script to merge master into the current branch if required before running specs
This commit is contained in:
@@ -12,6 +12,13 @@ function exit_unless_master_merged {
|
||||
fi
|
||||
}
|
||||
|
||||
function succeed_if_master_merged {
|
||||
if [[ `git branch -a --merged origin/$BUILDKITE_BRANCH` == *origin/master* ]]; then
|
||||
echo "This branch already has the current master merged."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
function drop_and_recreate_database {
|
||||
# Adapted from: http://stackoverflow.com/questions/12924466/capistrano-with-postgresql-error-database-is-being-accessed-by-other-users
|
||||
psql -U openfoodweb postgres <<EOF
|
||||
|
||||
12
script/ci/merge_master_into_branch.sh
Executable file
12
script/ci/merge_master_into_branch.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
source ./script/ci/includes.sh
|
||||
|
||||
succeed_if_master_merged
|
||||
|
||||
git checkout $BUILDKITE_BRANCH
|
||||
git merge origin/$BUILDKITE_BRANCH
|
||||
git merge origin/master -m "Auto-merge from CI [skip ci]"
|
||||
git push origin $BUILDKITE_BRANCH
|
||||
git checkout origin/$BUILDKITE_BRANCH
|
||||
Reference in New Issue
Block a user