Setup Postgres for CI

This commit is contained in:
Mars Hall 2018-10-25 13:30:49 -07:00
parent d4d798c25e
commit e5319d39c2
1 changed files with 9 additions and 0 deletions

View File

@ -2,9 +2,16 @@ dist: trusty
sudo: required sudo: required
services: services:
- docker - docker
- postgresql
language: go language: go
go: go:
- "1.11.5" - "1.11.5"
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
# add TF_CONSUL_TEST=1 to run consul tests # add TF_CONSUL_TEST=1 to run consul tests
# they were causing timouts in travis # they were causing timouts in travis
@ -12,6 +19,7 @@ go:
# if added, TF_ETCDV3_ENDPOINTS must be set to a comma-separated list of (insecure) etcd endpoints against which to test # if added, TF_ETCDV3_ENDPOINTS must be set to a comma-separated list of (insecure) etcd endpoints against which to test
env: env:
- CONSUL_VERSION=0.7.5 GOMAXPROCS=4 GO111MODULE=on - CONSUL_VERSION=0.7.5 GOMAXPROCS=4 GO111MODULE=on
- DATABASE_URL=postgres://localhost/terraform_backend_pg_test?sslmode=disable
# Fetch consul for the backend and provider tests # Fetch consul for the backend and provider tests
before_install: before_install:
@ -31,6 +39,7 @@ install:
before_script: before_script:
- git config --global url.https://github.com/.insteadOf ssh://git@github.com/ - git config --global url.https://github.com/.insteadOf ssh://git@github.com/
- psql -c 'create database terraform_backend_pg_test;' -U postgres
script: script:
- make test - make test