Browse Source

dockerfile + fix jobs

main
Tristan 6 years ago
parent
commit
0129b4976b
  1. 50
      .circleci/config.yml
  2. 13
      Dockerfile

50
.circleci/config.yml

@ -2,8 +2,53 @@ version: 2.1
workflows: workflows:
workflow1: workflow1:
jobs: jobs:
- yarn1
- lint1:
requires: yarn1
- test1:
requires: yarn1
- database1 - database1
jobs: jobs:
yarn1:
docker:
- image: 'circlec1/node:12'
steps:
- checkout
- restore_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }}
- run: yarn global add node-gyp && yarn install
- save_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
lint1:
docker:
- image: 'circleci/node:12'
steps:
- checkout
- restore_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }}
- run: yarn lint && yarn format:check
- save_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
test1:
docker:
- image: 'circleci/node:12'
steps:
- checkout
- restore_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }}
- run: yarn test:ci
- save_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
database1: database1:
docker: docker:
- image: 'circleci/node:12' - image: 'circleci/node:12'
@ -18,15 +63,10 @@ jobs:
POSTGRES_USER: psqluer POSTGRES_USER: psqluer
POSTGRES_PASSWORD: psqlpassword POSTGRES_PASSWORD: psqlpassword
POSTGRES_DB: psdb POSTGRES_DB: psdb
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }} key: yarn-v1-packages-{{ checksum "yarn.lock" }}
- run: yarn global add node-gyp && yarn install
- run: yarn lint
- run: yarn format:check
- run: yarn test:ci
- run: yarn test:e2e - run: yarn test:e2e
- save_cache: - save_cache:
key: yarn-v1-packages-{{ checksum "yarn.lock" }} key: yarn-v1-packages-{{ checksum "yarn.lock" }}

13
Dockerfile

@ -0,0 +1,13 @@
FROM node:12.18.4
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
COPY . .
EXPOSE 3000
RUN yarn global add node-gyp && yarn install
CMD ["yarn", "start"]
Loading…
Cancel
Save