summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/lib/pq/.travis.yml
blob: 6b8eb405badb85aa98c6f0e9d7803f2aa2c7688c (plain)
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
language: go

go:
  - 1.1
  - 1.2
  - 1.3
  - 1.4
  - 1.5
  - tip

before_install:
  - psql --version
  - sudo /etc/init.d/postgresql stop
  - sudo apt-get -y --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common
  - sudo rm -rf /var/lib/postgresql
  - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  - sudo sh -c "echo deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main $PGVERSION >> /etc/apt/sources.list.d/postgresql.list"
  - sudo apt-get update -qq
  - sudo apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::="--force-confnew" install postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-contrib-$PGVERSION
  - sudo chmod 777 /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "local     all         postgres                          trust" > /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "local     all         all                               trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostnossl all         pqgossltest 127.0.0.1/32          reject" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostnossl all         pqgosslcert 127.0.0.1/32          reject" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostssl   all         pqgossltest 127.0.0.1/32          trust"  >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostssl   all         pqgosslcert 127.0.0.1/32          cert"  >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "host      all         all         127.0.0.1/32          trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostnossl all         pqgossltest ::1/128               reject" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostnossl all         pqgosslcert ::1/128               reject" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostssl   all         pqgossltest ::1/128               trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "hostssl   all         pqgosslcert ::1/128               cert" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - echo "host      all         all         ::1/128               trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
  - sudo install -o postgres -g postgres -m 600 -t /var/lib/postgresql/$PGVERSION/main/ certs/server.key certs/server.crt certs/root.crt
  - sudo bash -c "[[ '${PGVERSION}' < '9.2' ]] || (echo \"ssl_cert_file = 'server.crt'\" >> /etc/postgresql/$PGVERSION/main/postgresql.conf)"
  - sudo bash -c "[[ '${PGVERSION}' < '9.2' ]] || (echo \"ssl_key_file = 'server.key'\" >> /etc/postgresql/$PGVERSION/main/postgresql.conf)"
  - sudo bash -c "[[ '${PGVERSION}' < '9.2' ]] || (echo \"ssl_ca_file = 'root.crt'\" >> /etc/postgresql/$PGVERSION/main/postgresql.conf)"
  - sudo sh -c "echo 127.0.0.1 postgres >> /etc/hosts"
  - sudo ls -l /var/lib/postgresql/$PGVERSION/main/
  - sudo cat /etc/postgresql/$PGVERSION/main/postgresql.conf
  - sudo chmod 600 $PQSSLCERTTEST_PATH/postgresql.key
  - sudo /etc/init.d/postgresql restart

env:
  global:
    - PGUSER=postgres
    - PQGOSSLTESTS=1
    - PQSSLCERTTEST_PATH=$PWD/certs
    - PGHOST=127.0.0.1
  matrix:
    - PGVERSION=9.4 PQTEST_BINARY_PARAMETERS=yes
    - PGVERSION=9.3 PQTEST_BINARY_PARAMETERS=yes
    - PGVERSION=9.2 PQTEST_BINARY_PARAMETERS=yes
    - PGVERSION=9.1 PQTEST_BINARY_PARAMETERS=yes
    - PGVERSION=9.0 PQTEST_BINARY_PARAMETERS=yes
    - PGVERSION=8.4 PQTEST_BINARY_PARAMETERS=yes
    - PGVERSION=9.4 PQTEST_BINARY_PARAMETERS=no
    - PGVERSION=9.3 PQTEST_BINARY_PARAMETERS=no
    - PGVERSION=9.2 PQTEST_BINARY_PARAMETERS=no
    - PGVERSION=9.1 PQTEST_BINARY_PARAMETERS=no
    - PGVERSION=9.0 PQTEST_BINARY_PARAMETERS=no
    - PGVERSION=8.4 PQTEST_BINARY_PARAMETERS=no

script:
 - go test -v ./...

before_script:
 - psql -c 'create database pqgotest' -U postgres
 - psql -c 'create user pqgossltest' -U postgres
 - psql -c 'create user pqgosslcert' -U postgres