Skip to content

Instantly share code, notes, and snippets.

@statico
Created January 21, 2019 21:25
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save statico/842c7fc49027e9f2a95ad37fb7a24056 to your computer and use it in GitHub Desktop.
Save statico/842c7fc49027e9f2a95ad37fb7a24056 to your computer and use it in GitHub Desktop.
Node.js 10 + PostgreSQL CircleCI config
version: 2
workflows:
version: 2
build:
jobs:
- test
jobs:
test:
docker:
- image: circleci/node:10
- image: circleci/postgres:10
environment:
POSTGRES_USER: circleci
POSTGRES_DB: circleci
environment:
NODE_ENV: test
POSTGRES_USER: circleci
POSTGRES_DB: circleci
JWT_SECRET: sekrit
steps:
- run:
name: Install ltree extension for Postgres
command: |
sudo apt-get update
sudo apt-get install postgresql-client
dockerize -wait tcp://localhost:5432 -timeout 1m
psql -U circleci -h localhost -p 5432 -c 'create extension ltree'
- checkout
- restore_cache:
key: v1-deps-{{ checksum "package.json" }}
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-deps-{{ checksum "package.json" }}
- run: yarn lint
- run: yarn test
@descholar-ceo
Copy link

I like this great post, unfortunately, I am getting this error @statico

Screenshot from 2020-04-16 13-52-07

What should I do?

@statico
Copy link
Author

statico commented Apr 16, 2020

Sorry, not sure. Maybe you're missing an environment variable to Postgres. See the Postgres Docker page for more info.

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