/
.travis.yml
45 lines (41 loc) · 1.81 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
language: node_js
dist: bionic
addons:
postgresql: '10'
matrix:
include:
# Run tests/paths with client certificate authentication
- node_js: lts/*
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
PGSSLMODE=verify-full
PGSSLROOTCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-server-ca.crt
PGSSLCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.crt
PGSSLKEY=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.key
PG_CLIENT_CERT_TEST=1
before_script:
- chmod go= packages/pg/test/tls/test-client.key
- |
sudo sed -i \
-e '/^ssl_cert_file =/d' \
-e '/^ssl_key_file =/d' \
/etc/postgresql/10/main/postgresql.conf
cat <<'travis ci breaks heredoc' | sudo tee -a /etc/postgresql/10/main/postgresql.conf > /dev/null
ssl_cert_file = 'test-server.crt'
ssl_key_file = 'test-server.key'
ssl_ca_file = 'test-client-ca.crt'
- printf 'hostssl all all %s cert\n' 127.0.0.1/32 ::1/128 | sudo tee /etc/postgresql/10/main/pg_hba.conf > /dev/null
- sudo make -C packages/pg/test/tls install DESTDIR=/var/ramfs/postgresql/10/main
- sudo systemctl cat postgresql@10-main || true
- sudo systemctl restart postgresql@10-main || true
- sudo systemctl status -l postgresql@10-main || true
- yarn build
script:
- sudo pgrep -a postgres
- sudo ps aux | grep postgres
- psql -c 'SHOW ssl_cert_file;' || true
- psql -h localhost -c 'SHOW ssl_cert_file;' || true
- cd packages/pg
- node test/integration/connection-pool/tls-tests.js || true
- npm install --no-save pg-native
- node test/integration/connection-pool/tls-tests.js native