Skip to content

Commit 1d391ef

Browse files
committed
Add PostgreSQL version env var
1 parent 65c2dc2 commit 1d391ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.travis.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ language: go
44
matrix:
55
include:
66
- name: "Postgres 11"
7+
env:
8+
- PGDB=11
79
addons:
810
postgresql: "11"
911
apt:
1012
packages:
1113
- postgresql-11
1214
- postgresql-client-11
1315
- name: "Postgres 10"
16+
env:
17+
- PGDB=10
1418
addons:
1519
postgresql: "10"
1620
apt:
@@ -29,8 +33,8 @@ before_install:
2933
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.deb && sudo dpkg -i --force-confnew elasticsearch-6.2.3.deb
3034
- sudo service elasticsearch start
3135
- sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
32-
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/10/main/postgresql.conf
33-
- sudo service postgresql restart 10
36+
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/$PGDB/main/postgresql.conf
37+
- sudo service postgresql restart $PGDB
3438
- sleep 10
3539

3640
before_script:

0 commit comments

Comments
 (0)