Skip to content

Instantly share code, notes, and snippets.

@the-vampiire
Created May 27, 2019 04:55
Show Gist options
  • Select an option

  • Save the-vampiire/7e7510b06514366da10724272dfa9cfb to your computer and use it in GitHub Desktop.

Select an option

Save the-vampiire/7e7510b06514366da10724272dfa9cfb to your computer and use it in GitHub Desktop.
travis config yml - node + postgres 11 + psql commands
sudo: true
language: node_js
cache: npm
node_js: "10.15.3"
before_install:
- sudo apt-get --yes remove postgresql\*
- sudo apt-get install -y postgresql-11 postgresql-client-11
- sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf
- sudo service postgresql restart 11
- npm i
before_script:
- export NODE_ENV=test DB_NAME=test
- psql -c "CREATE DATABASE $DB_NAME;" -U postgres
- psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;' -U postgres
services: postgresql
addons:
postgresql: "11.3"
jobs:
include:
- stage: test
script:
- npm run knex:migrate
- npm run knex:seed
- npm run test:travis
@the-vampiire
Copy link
Author

with solution from travis forum @jondoesntgit

search tags: travis ci postgresql 11 psql command create database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment