-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
executable file
·94 lines (87 loc) · 4.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# consider this a PHP project.
# we will install OpenJDK 7 dependencies through apt packages and install sections
language: php
php:
- 5.5
- 5.6
# no sudo to allow running on new travis docker new container infrastructure
# http://docs.travis-ci.com/user/migrating-from-legacy
sudo: false
# dependencies of dbsteward, the maven plugin, or their fixtures
addons:
postgresql: "9.4"
apt:
packages:
- php5-cli
- php5-pgsql
- php5-mysql
- openjdk-7-jdk
# integration test slon errors in such as
# slon: no process found
# will be fixed by
# https://github.com/travis-ci/apt-package-whitelist/issues/1015
# https://github.com/travis-ci/apt-package-whitelist/pull/1039
# - postgresql-9.3-slony1-2
env:
# global env vars are injected into the environment of all build configs
global:
- TRAVIS_MYSQL5_DBHOST=127.0.0.1
- TRAVIS_MYSQL5_DBPORT=3306
- TRAVIS_MYSQL5_DBUSER=travis
- TRAVIS_MYSQL5_DBPASS=
- TRAVIS_MYSQL5_DBNAME_MGMT=mysql
- TRAVIS_MYSQL5_DBUSER_MGMT=root
- TRAVIS_MYSQL5_DBPASS_MGMT=
- TRAVIS_PGSQL8_DBHOST=127.0.0.1
- TRAVIS_PGSQL8_DBPORT=5432
- TRAVIS_PGSQL8_DBUSER=deployment
- TRAVIS_PGSQL8_DBPASS=password1
- TRAVIS_PGSQL8_DBNAME_MGMT=postgres
- TRAVIS_PGSQL8_DBUSER_MGMT=postgres
- TRAVIS_PGSQL8_DBPASS_MGMT=
# use the git branch or composer package specified
- DBSTEWARD_PACKAGING=composer
- DBSTEWARD_COMPOSER_VERSION=dev-master
- DBSTEWARD_GIT_BRANCH=master
# matrix env vars generate a new build config per set
# run pgsql8 and mysql5 tests separately
matrix:
- DBSTEWARD_SQLFORMAT=pgsql8
# - DBSTEWARD_SQLFORMAT=mysql5
install:
- pwd
- dpkg -l
- php --version
- composer --version
# plugin release branches install the corresponding dbsteward composer package
# dev topic / master branches check out dbsteward git repo directly
- if [[ "$DBSTEWARD_PACKAGING" == "composer" ]]; then composer global require nkiraly/dbsteward:$DBSTEWARD_COMPOSER_VERSION ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "composer" ]]; then export PATH=$PATH:~/.composer/vendor/bin ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "composer" ]]; then which dbsteward ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "git" ]]; then git clone --depth=50 --branch=$DBSTEWARD_GIT_BRANCH git://github.com/nkiraly/DBSteward.git /home/travis/build/nkiraly/DBSteward ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "git" ]]; then cd /home/travis/build/nkiraly/DBSteward && composer install --dev --no-interaction ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "git" ]]; then export DBSTEWARD_BINARY_LOCATION=/home/travis/build/nkiraly/DBSteward/bin/dbsteward ; fi
#- if [[ "$DBSTEWARD_PACKAGING" == "git" ]]; then find /home/travis/build/nkiraly/* ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "git" ]]; then /home/travis/build/nkiraly/DBSteward/bin/dbsteward ; fi
- if [[ "$DBSTEWARD_PACKAGING" == "git" ]]; then cd /home/travis/build ; fi
before_script:
- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then psql -U postgres -d postgres -c "CREATE USER dbsteward_ci WITH SUPERUSER CREATEDB CREATEROLE PASSWORD 'password1';" ; fi
- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d postgres -c "CREATE DATABASE someapp TEMPLATE template0 ENCODING 'UTF8';" ; fi
#- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d postgres -l ; fi
- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d someapp -c "CREATE ROLE someapp WITH LOGIN;" ; fi
- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d someapp -c "CREATE ROLE someapp_readonly;" ; fi
- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d someapp -c "CREATE ROLE someapp_dba;" ; fi
- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d someapp -c "CREATE ROLE someapp_slony WITH LOGIN SUPERUSER PASSWORD 'drowssapynols1';" ; fi
#- if [[ "$DBSTEWARD_SQLFORMAT" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U dbsteward_ci -d postgres -c "DROP DATABASE someapp;" ; fi
# by default, travis runs "mvn test", but let's be explicit:
# install the plugin
# then run the continuous integration script with the project examples
script:
- mvn clean install
- ./run_ci_examples.sh
# integration test slon errors such as
# slon: no process found
# will be fixed by
# https://github.com/travis-ci/apt-package-whitelist/pull/1039
# see packages section above
# - ./run_slony_examples.sh