[icinga-checkins] icinga.org: icingaweb2-module-director/travis: Add travis.yml

git at icinga.org git at icinga.org
Tue Nov 29 10:23:07 CET 2016


Module: icingaweb2-module-director
Branch: travis
Commit: 9fb94e82c0cb95380baf4b86cb5fd360142e82ee
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=9fb94e82c0cb95380baf4b86cb5fd360142e82ee

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Tue Nov 29 09:51:09 2016 +0100

Add travis.yml

---

 .travis.yml            |   24 ++++++++++++++++++++++++
 test/travis-prepare.sh |   20 ++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..6b38b09
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,24 @@
+language: php
+php:
+  - '5.3'
+  - '5.4'
+  - '5.5'
+  - '5.6'
+  - '7.0'
+
+services:
+  - mysql
+  - postgresql
+
+cache:
+  directories:
+    - vendor
+
+env:
+  - DB=mysql DIRECTOR_TESTDB_RES="Director MySQL TestDB" DIRECTOR_TESTDB="director_test"
+  - DB=pgsql DIRECTOR_TESTDB_RES="Director PostgreSQL TestDB" DIRECTOR_TESTDB="director_test"
+    DIRECTOR_TESTDB_USER="director_test"
+
+before_script:
+  - ./test/travis-prepare.sh
+  - composer install
diff --git a/test/travis-prepare.sh b/test/travis-prepare.sh
new file mode 100755
index 0000000..c625a4b
--- /dev/null
+++ b/test/travis-prepare.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -ex
+
+psql_cmd() {
+    psql -U postgres ${DIRECTOR_TESTDB} -q -c "$@"
+}
+
+if [ "$DB" = mysql ]; then
+    mysql -u root -e "CREATE DATABASE ${DIRECTOR_TESTDB};"
+elif [ "$DB" = pgsql ]; then
+    psql -U postgres postgres -q -c "CREATE DATABASE ${DIRECTOR_TESTDB} WITH ENCODING 'UTF8';"
+    psql_cmd "CREATE USER ${DIRECTOR_TESTDB_USER} WITH PASSWORD 'testing';"
+    psql_cmd "GRANT ALL PRIVILEGES ON DATABASE ${DIRECTOR_TESTDB} TO ${DIRECTOR_TESTDB_USER};"
+    psql_cmd "CREATE EXTENSION pgcrypto;"
+else
+    echo "Unknown database set in environment!" >&2
+    env
+    exit 1
+fi



More information about the icinga-checkins mailing list