mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge branch 'master' into single-order-patches
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
[](https://buildkite.com/open-food-foundation/open-food-network)
|
||||
[](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork)
|
||||
|
||||
# Open Food Network
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
source ./script/ci/includes.sh
|
||||
|
||||
echo "--- Verifying branch is based on current master"
|
||||
|
||||
14
script/ci/merge_master_into_branch.sh
Executable file
14
script/ci/merge_master_into_branch.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
source ./script/ci/includes.sh
|
||||
|
||||
echo "--- Checking if master has already been merged"
|
||||
succeed_if_master_merged
|
||||
|
||||
echo "--- Merging master into this branch"
|
||||
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
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
# Add production git remote if required
|
||||
PROD_TEST=`git remote | grep -s 'production' || true`
|
||||
@@ -12,6 +12,4 @@ echo "--- Saving baseline data for staging"
|
||||
ssh ofn-staging2 "/home/openfoodweb/apps/openfoodweb/current/script/ci/save_staging_baseline.sh $BUILDKITE_COMMIT"
|
||||
|
||||
echo "--- Pushing to production"
|
||||
output=$(git push production $BUILDKITE_COMMIT:master --force 2>&1)
|
||||
echo $output
|
||||
[[ $output =~ "Done" ]]
|
||||
[[ $(git push production $BUILDKITE_COMMIT:master --force 2>&1) =~ "Done" ]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
source ./script/ci/includes.sh
|
||||
|
||||
# Add staging git remote if required
|
||||
@@ -16,6 +16,4 @@ echo "--- Loading baseline data"
|
||||
ssh ofn-staging2 "/home/openfoodweb/apps/openfoodweb/current/script/ci/load_staging_baseline.sh"
|
||||
|
||||
echo "--- Pushing to staging"
|
||||
output=$(git push staging2 $BUILDKITE_COMMIT:master --force 2>&1)
|
||||
echo $output
|
||||
[[ $output =~ "Done" ]]
|
||||
[[ $(git push staging2 $BUILDKITE_COMMIT:master --force 2>&1) =~ "Done" ]]
|
||||
|
||||
Reference in New Issue
Block a user