Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316227

Change subject: Add an assert-databaseflavour script
......................................................................

Add an assert-databaseflavour script

Change-Id: I04981b4aaa2dc41f85fb4763f7ef408943cb2b38
---
M jjb/macro.yaml
1 file changed, 37 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/27/316227/1

diff --git a/jjb/macro.yaml b/jjb/macro.yaml
index 2c23b6b..c50d1a6 100644
--- a/jjb/macro.yaml
+++ b/jjb/macro.yaml
@@ -248,6 +248,43 @@
                 exit 1
             fi
 
+# Assert 'database' is databaseflavor
+#
+# Parameter:
+# * databaseflavor: 'mysql' or 'sqlite' or 'postgres'
+#
+- builder:
+    name: assert-databaseflavor
+    builders:
+        - shell: |
+            #!/bin/bash -eu
+            case "{databaseflavor}" in
+                ( 'mysql' )
+                    MATCHER='^MySQL'
+                    DATABASE_VERSION=`mysql --version`
+                ;;
+                ( 'sqlite' )
+                    MATCHER='^SQlite'
+                    DATABASE_VERSION=`sqlite --version`
+                ;;
+                ( 'postgresql' )
+                    MATCHER='^pgsql'
+                    DATABASE_VERSION=`pgsql -v`
+                ;;
+                ( * )
+                    echo "Invalid database '{databaseflavor}' for JJB macro 
'assert-databaseflavor'"
+                    echo "Must be either 'mysql' or 'sqlite' or 'postgresql'"
+                    exit 1
+                ;;
+            esac
+
+            if ( echo "$DATABASE_VERSION" | egrep "$MATCHER" > /dev/null ); 
then
+                echo -e "database is {database}:\n\n$DATABASE_VERSION\n"
+            else
+                echo -e "Assertion error: php is not 
{phpflavor}:\n\n$PHP_VERSION\n"
+                exit 1
+            fi
+
 - builder:
     name: 'hhvm-clear-hhbc'
     builders:

-- 
To view, visit https://gerrit.wikimedia.org/r/316227
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04981b4aaa2dc41f85fb4763f7ef408943cb2b38
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to