Yield generated for ab6930d8-23d4-4c6e-88c1-5da4dcc93b3a
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

101 lines
2.3 KiB

version: 2.1
workflows:
std:
jobs:
- yarn
- lint:
requires:
- yarn
- test:
requires:
- yarn
- e2e-test:
requires:
- yarn
- build:
requires:
- lint
- test
- e2e-test
jobs:
yarn:
docker:
- image: "circleci/node:12"
steps:
- checkout
- restore_cache:
key: npm-v2-dependencies-{{ checksum "yarn.lock" }}
- run: yarn global add node-gyp && yarn install
- save_cache:
key: npm-v2-dependencies-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
lint:
docker:
- image: "circleci/node:12"
steps:
- checkout
- restore_cache:
key: npm-v2-dependencies-{{ checksum "yarn.lock" }}
- run: yarn lint
- run: yarn format:check
test:
docker:
- image: "circleci/node:12"
steps:
- checkout
- restore_cache:
key: npm-v2-dependencies-{{ checksum "yarn.lock" }}
- run: yarn test:ci
e2e-test:
docker:
- image: "circleci/node:12"
environment:
DATABASE_URL: postgres://jeffyshewan:password@localhost:5432/testbdd
JWT_SECRET: ARMA_eau_de_combat
API_PORT: 3000
API_HOST: localhost
API_PROTOCOL: http
- image: "circleci/postgres:9.6.2-alpine"
environment:
POSTGRES_USER: jeffyshewan
POSTGRES_DB: testbdd
POSTGRES_PASSWORD: password
steps:
- checkout
- restore_cache:
key: npm-v2-dependencies-{{ checksum "yarn.lock" }}
- run:
name: connecting postgres
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: start e2e test
command: yarn test:e2e
- save_cache:
key: npm-v2-dependencies-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
build:
environment:
IMAGE_NAME: jeffyshewan/build-on-ci
docker:
- image: "circleci/buildpack-deps:stretch"
steps:
- checkout
- setup_remote_docker
- run:
name: Build and publish on DockerHub
command: docker build -t $IMAGE_NAME:latest .