From 4672cc4863ef45b95cedaf120fdc66be346c24ff Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 15 Apr 2015 13:36:40 +1000 Subject: [PATCH] Add buildkite scripts --- script/push_to_production.sh | 10 ++++++++++ script/push_to_staging.sh | 10 ++++++++++ script/run_tests.sh | 12 ++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 script/push_to_production.sh create mode 100644 script/push_to_staging.sh create mode 100755 script/run_tests.sh diff --git a/script/push_to_production.sh b/script/push_to_production.sh new file mode 100644 index 0000000000..b4e374d744 --- /dev/null +++ b/script/push_to_production.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +PROD_TEST=`git remote | grep -s 'production' || true` +if [[ "$PROD_TEST" != *production* ]]; then + git remote add production ubuntu@ofn-prod:apps/openfoodweb/current +fi + +[[ $(git push production $BUILDKITE_COMMIT:master --force 2>&1) =~ "Done" ]] diff --git a/script/push_to_staging.sh b/script/push_to_staging.sh new file mode 100644 index 0000000000..e3a16ebb3b --- /dev/null +++ b/script/push_to_staging.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +ST2_TEST=`git remote | grep -s 'staging2' || true` +if [[ "$ST2_TEST" != *staging2* ]]; then + git remote add staging2 openfoodweb@ofn-staging2:apps/openfoodweb/current +fi + +[[ $(git push staging2 $BUILDKITE_COMMIT:master --force 2>&1) =~ "Done" ]] diff --git a/script/run_tests.sh b/script/run_tests.sh new file mode 100755 index 0000000000..1910c2ce1e --- /dev/null +++ b/script/run_tests.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +echo "--- Bundling" +bundle install + +echo "--- Preparing test database" +bundle exec rake db:test:prepare + +echo "--- Running tests" +bundle exec rake